mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
DB changes
This commit is contained in:
parent
ea41412aac
commit
9484b11c41
4 changed files with 6 additions and 22 deletions
|
@ -2,15 +2,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
def add_admin(apps, schema_editor):
|
||||
add_user = User.objects.create_user("admin", None, "admin")
|
||||
add_user.is_active = True
|
||||
add_user.is_superuser = True
|
||||
add_user.is_staff = True
|
||||
add_user.save()
|
||||
def add_useradmin(apps, schema_editor):
|
||||
from django.contrib.auth.models import User
|
||||
# Broken in Django 1.8
|
||||
#User.objects.create_superuser("admin", None, "admin")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
@ -20,5 +17,5 @@ class Migration(migrations.Migration):
|
|||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(add_admin),
|
||||
migrations.RunPython(add_useradmin),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue