(main, alias)
return
Merge alias profile into main
Merge alias profile into main
Merge alias profile into main
def merge_profiles(main, alias):
    """
    Merge alias profile into main
    """

    # Transfer posts
    Post.objects.filter(author=alias).update(author=main)
    Post.objects.filter(lastedit_user=alias).update(lastedit_user=main)

    # Transfer messages
    Message.objects.filter(sender=alias).update(sender=main)
    Message.objects.filter(recipient=alias).update(recipient=main)

    # Do not delete older accounts.
    older = (alias.profile.date_joined < main.profile.date_joined)

    if alias.profile.is_moderator or alias.profile.high_rep or older:
        return

    alias.delete()

    return
def merge_profiles ( main , alias ) : # Transfer posts Post . objects . filter ( author = alias ) . update ( author = main ) Post . objects . filter ( lastedit_user = alias ) . update ( lastedit_user = main ) # Transfer messages Message . objects . filter ( sender = alias ) . update ( sender = main ) Message . objects . filter ( recipient = alias ) . update ( recipient = main ) # Do not delete older accounts. older = ( alias . profile . date_joined < main . profile . date_joined ) if alias . profile . is_moderator or alias . profile . high_rep or older : return alias . delete ( ) return