Skip to content

Commit

Permalink
clean up comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Nov 13, 2024
1 parent 554a797 commit a9c801e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lacommunaute/openid_connect/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ def create_or_update_user(self):
user = User.objects.get(username=self.username, identity_provider=self.identity_provider)
created = False
except User.DoesNotExist:
# User.objects.create_user does the following:
# - set User.is_active to true,
# - call User.set_unusable_password() if no password is given.
# https://docs.djangoproject.com/fr/4.0/ref/contrib/auth/#django.contrib.auth.models.UserManager.create_user
# NB: if we already have a user with the same username but with a different email and a different
# provider the code will break here. We know it but since it's highly unlikely we just added a test
# on this behaviour. No need to do a fancy bypass if it's never used.
try:
# look for a user with the same email but not yet migrated from Inclusion Connect to Pro Connect
user = User.objects.get(email=self.email, identity_provider=IdentityProvider.INCLUSION_CONNECT)
Expand Down

0 comments on commit a9c801e

Please sign in to comment.