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

16 lines
435 B
Python
Raw Normal View History

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