🐛 Use set_email in createsuperuser
This commit is contained in:
parent
6120c151f1
commit
e848601f79
1 changed files with 3 additions and 2 deletions
|
|
@ -75,7 +75,7 @@ def shell(root: str = "."):
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
loop.run_until_complete(init_and_cleanup())
|
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}
|
shell_vars = {"p": project}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
@ -150,8 +150,9 @@ def createsuperuser(root: str = "."):
|
||||||
if password1 != password2:
|
if password1 != password2:
|
||||||
print("Passwords didn't match!")
|
print("Passwords didn't match!")
|
||||||
user = ohmyapi_auth.models.User(
|
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)
|
user.set_password(password1)
|
||||||
asyncio.run(project.init_orm())
|
asyncio.run(project.init_orm())
|
||||||
asyncio.run(user.save())
|
asyncio.run(user.save())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue