Skip to content
Snippets Groups Projects
Commit c802df8c authored by Mart van Santen's avatar Mart van Santen
Browse files

Change behaviour of user creation

parent f2f06b1f
No related branches found
No related tags found
2 merge requests!68Merge loginpanel into main and release 0.5.0,!62Resolve "Embed login panel in helmchart"
Pipeline #10200 failed with stages
in 1 minute and 23 seconds
......@@ -226,6 +226,11 @@ def create_user(email):
app.logger.info(f"Creating user with email: ({email})")
# Create a user
user = KratosUser.find_by_email(KRATOS_ADMIN, email)
if user:
app.logger.info(f"User already exists. Not recreating")
return
user = KratosUser(KRATOS_ADMIN)
user.email = email
user.save()
......@@ -242,7 +247,7 @@ def setpassword_user(email, password):
:raise: exception if unexepted error happens
"""
app.logger.info(f"Creating user with email: ({email})")
app.logger.info(f"Setting password for: ({email})")
# Kratos does not provide an interface to set a password directly. However
# we still want to be able to set a password. So we have to hack our way
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment