OpenSlides/server/openslides/users/management/commands/createsuperuser.py
Finn Stutzenstein ca56b4f8b4
Use cache in management commands
This requires to have a correct setup when using these commands
2020-10-19 15:29:59 +02:00

19 lines
526 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(self.style.SUCCESS("Admin user successfully created."))
else:
self.stdout.write(self.style.SUCCESS("Admin user successfully reset."))