mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
Fix default admin user
- Fix error: RelatedObjectDoesNotExist: User has no userattributes. "instances/views.py", line 162, in check_user_quota
This commit is contained in:
parent
d9fa43463b
commit
618d88f1c4
1 changed files with 3 additions and 1 deletions
|
@ -6,8 +6,10 @@ from django.db import migrations
|
||||||
def add_useradmin(apps, schema_editor):
|
def add_useradmin(apps, schema_editor):
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
from accounts.models import UserAttributes
|
||||||
|
|
||||||
User.objects.create_superuser('admin', None, 'admin', last_login=timezone.now())
|
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()
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
Loading…
Reference in a new issue