Skip to content

Commit 6075989

Browse files
Merge pull request #519 from sakonduri/sort_bug_fix
Fix for sorting issue in write_stray_key_map #518
2 parents 49d2ac8 + 9017002 commit 6075989

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

user_sync/rules.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,9 +1092,7 @@ def write_stray_key_map(self):
10921092
if not secondary_count:
10931093
fieldnames.append('umapi')
10941094
secondary_count += 1
1095-
# None sorts before strings, so sorting the keys in the map
1096-
# puts the primary umapi first in the output, which is handy
1097-
for umapi_name in sorted(self.stray_key_map.keys()):
1095+
for umapi_name in self.stray_key_map:
10981096
for user_key in self.get_stray_keys(umapi_name):
10991097
id_type, username, domain = self.parse_user_key(user_key)
11001098
umapi = umapi_name if umapi_name else ""
@@ -1103,6 +1101,7 @@ def write_stray_key_map(self):
11031101
else:
11041102
row_dict = {'type': id_type, 'username': username, 'domain': domain}
11051103
rows.append(row_dict)
1104+
11061105
CSVAdapter.write_csv_rows(file_path, fieldnames, rows)
11071106
user_count = len(self.stray_key_map.get(PRIMARY_UMAPI_NAME, []))
11081107
user_plural = "" if user_count == 1 else "s"

0 commit comments

Comments
 (0)