Skip to content

Commit

Permalink
Merge pull request #12193 from rtibbles/username_doesnt_exist
Browse files Browse the repository at this point in the history
Handle case when username doesn't exist on remote and try to create it.
  • Loading branch information
rtibbles authored May 23, 2024
2 parents 4abdca3 + 0c8e419 commit 9027de7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kolibri/plugins/user_profile/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def validate(self, data):
details = e.detail if isinstance(e.detail, list) else [e.detail]
for detail in details:
# If any of the errors are authentication related, then we need to create the user
if detail.code == error_constants.AUTHENTICATION_FAILED:
if (
detail.code == error_constants.AUTHENTICATION_FAILED
or detail.code == error_constants.INVALID_USERNAME
):
self.create_remote_user(data)
job_data = super(MergeUserValidator, self).validate(data)
break
Expand Down

0 comments on commit 9027de7

Please sign in to comment.