Skip to content

Commit

Permalink
fix:import-duplicate-usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
nick2432 committed Feb 22, 2024
1 parent 5cbec33 commit 7b08d47
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions kolibri/core/auth/management/commands/bulkimportusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,13 @@ def add_check(self, header_name, check, message):

def get_username(self, row):
username = row.get(self.header_translation["USERNAME"])
if username in self.users.keys():
return None
lowercase_username = username.lower()

# Convert existing keys in self.users to lowercase
lowercase_users = {key.lower(): value for key, value in self.users.items()}

if lowercase_username in lowercase_users:
return None # Duplicate username

return username

Expand Down

0 comments on commit 7b08d47

Please sign in to comment.