Browse Source

Merge pull request #5647 from getsentry/cli/improve-merge-prioritization

cli: improve prioritization of merge_users
David Cramer 7 years ago
parent
commit
3b174cd894
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/sentry/management/commands/merge_users.py

+ 1 - 1
src/sentry/management/commands/merge_users.py

@@ -80,7 +80,7 @@ class Command(BaseCommand):
         sys.stdout.write("Found {} unique account(s) with duplicate identities.\n".format(len(unique_users)))
 
         for user_list in unique_users:
-            user_list.sort(key=lambda x: x.date_joined)
+            user_list.sort(key=lambda x: (x.is_superuser, not x.managed, x.date_joined))
 
             primary_user = user_list[0]
             if not noinput and not self._confirm_merge(primary_user, user_list[1:]):