Commit c8ffcfe6 authored by David Seaward's avatar David Seaward
Browse files

account for existing entries in the user table (eg. after a failed deployment)

parent ba01293a
......@@ -75,7 +75,15 @@ class AuthenticationBackend(BaseBackend):
if self.is_valid_jwt(normalized_username, password):
user = user_model(username=username, email=None)
# try to get a preexisting user object
# otherwise create a new one
user = user_model.objects.get(username=username)
except user_model.DoesNotExist:
user = user_model(username=username, email=None)
# update/set user details = user.get_identity()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment