User setup stuff

This commit is contained in:
zandercymatics 2024-05-09 12:13:01 -06:00
parent dda620ee4d
commit 2f36033eb2
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 4 additions and 1 deletions

View file

@ -60,6 +60,7 @@ class OpenIdConnectBackend(ModelBackend):
else:
try:
user = UserModel.objects.get_by_natural_key(username)
request.session["is_new_user"] = False
except UserModel.DoesNotExist:
return None
# run this callback for a each login

View file

@ -114,7 +114,9 @@ def login_callback(request):
user.set_user_verification_type()
should_update_user = True
if is_new_user:
# If we're dealing with a new user and if this field isn't set already,
# Then set this to False. Otherwise, if we set the field manually it'll revert.
if is_new_user and not user.finished_setup:
user.finished_setup = False
should_update_user = True