OpenSlides/openslides/users/management/commands/createsuperuser.py

16 lines
455 B
Python
Raw Normal View History

2015-01-16 14:18:34 +01:00
from django.core.management.base import NoArgsCommand
from openslides.users.models import User
2015-01-16 14:18:34 +01:00
class Command(NoArgsCommand):
"""
Command to create or reset the admin user.
2015-01-16 14:18:34 +01:00
"""
def handle_noargs(self, **options):
created = User.objects.create_or_reset_admin_user()
if created:
2015-01-16 14:18:34 +01:00
self.stdout.write('Admin user successfully created.')
else:
self.stdout.write('Admin user successfully reset.')