🐛 Use set_email in createsuperuser

This commit is contained in:
Brian Wiborg 2025-10-08 12:41:05 +02:00
parent 6120c151f1
commit e848601f79
No known key found for this signature in database

View file

@ -75,7 +75,7 @@ def shell(root: str = "."):
asyncio.set_event_loop(loop)
loop.run_until_complete(init_and_cleanup())
# Prepare shell vars that are to be directly available
# Prepare shell vars that are to be immediately available
shell_vars = {"p": project}
try:
@ -150,8 +150,9 @@ def createsuperuser(root: str = "."):
if password1 != password2:
print("Passwords didn't match!")
user = ohmyapi_auth.models.User(
email=email, username=username, is_staff=True, is_admin=True
username=username, is_staff=True, is_admin=True
)
user.set_email(email)
user.set_password(password1)
asyncio.run(project.init_orm())
asyncio.run(user.save())