
* policies/expression: migrate to raw python instead of jinja2 * lib/expression: create base evaluator, custom subclass for policies * core: rewrite propertymappings to use python * providers/saml: update to new PropertyMappings * sources/ldap: update to new PropertyMappings * docs: update docs for new propertymappings * root: remove jinja2 * root: re-add jinja to lock file as its implicitly required
30 lines
792 B
Python
30 lines
792 B
Python
# Generated by Django 3.0.6 on 2020-05-23 16:40
|
|
|
|
from django.apps.registry import Apps
|
|
from django.db import migrations
|
|
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
|
|
|
|
|
|
def create_default_user(apps: Apps, schema_editor: BaseDatabaseSchemaEditor):
|
|
# User = apps.get_model("passbook_core", "User")
|
|
from passbook.core.models import User
|
|
|
|
pbadmin = User.objects.create(
|
|
username="pbadmin", email="root@localhost", # password="pbadmin"
|
|
)
|
|
pbadmin.set_password("pbadmin") # nosec
|
|
pbadmin.is_superuser = True
|
|
pbadmin.is_staff = True
|
|
pbadmin.save()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("passbook_core", "0001_initial"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(create_default_user),
|
|
]
|