1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 23:55:24 +00:00
webvirtcloud/accounts/migrations/0002_addAdmin.py

24 lines
632 B
Python
Raw Normal View History

2020-04-17 11:03:42 +00:00
# Generated by Django 2.2.10 on 2020-01-28 07:01
from django.db import migrations
def add_useradmin(apps, schema_editor):
from django.utils import timezone
from django.contrib.auth.models import User
from accounts.models import UserAttributes
2020-04-17 11:03:42 +00:00
admin = User.objects.create_superuser('admin', None, 'admin', last_login=timezone.now())
UserAttributes(user=admin, max_instances=-1, max_cpus=-1, max_memory=-1, max_disk_size=-1).save()
2020-04-17 11:03:42 +00:00
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.RunPython(add_useradmin),
]