core: fix integrity error for default user

closes #75
This commit is contained in:
Jens Langhammer 2020-06-18 19:04:13 +02:00
parent 2a5ee9b185
commit 3713d111a4
1 changed files with 2 additions and 2 deletions

View File

@ -6,10 +6,10 @@ from django.db.backends.base.schema import BaseDatabaseSchemaEditor
def create_default_user(apps: Apps, schema_editor: BaseDatabaseSchemaEditor):
# User = apps.get_model("passbook_core", "User")
# We have to use a direct import here, otherwise we get an object manager error
from passbook.core.models import User
pbadmin = User.objects.create(
pbadmin, _ = User.objects.get_or_create(
username="pbadmin", email="root@localhost", name="passbook Default Admin"
)
pbadmin.set_password("pbadmin") # noqa # nosec