OpenSlides/openslides/users/management/commands/createsuperuser.py
2019-01-08 21:51:52 +01:00

19 lines
486 B
Python

from django.core.management.base import BaseCommand
from ...models import User
class Command(BaseCommand):
"""
Command to create or reset the admin user.
"""
help = "Creates or resets the admin user."
def handle(self, *args, **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.")