OpenSlides/openslides/users/management/commands/createsuperuser.py
2015-09-21 16:23:47 +02:00

16 lines
441 B
Python

from django.core.management.base import NoArgsCommand
from ...models import User
class Command(NoArgsCommand):
"""
Command to create or reset the admin user.
"""
def handle_noargs(self, **options):
created = User.objects.create_or_reset_admin_user()
if created:
self.stdout.write('Admin user successfully created.')
else:
self.stdout.write('Admin user successfully reset.')