mirror of
https://github.com/YunoHost-Apps/django_example_ynh.git
synced 2024-09-03 18:26:21 +02:00
Make "--email" optional in "create_superuser" manage command
This commit is contained in:
parent
5a44039588
commit
9f0c74664d
1 changed files with 3 additions and 2 deletions
|
@ -26,7 +26,7 @@ class Command(BaseCommand):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--email",
|
"--email",
|
||||||
action="store",
|
action="store",
|
||||||
required=True,
|
default=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
|
@ -40,6 +40,7 @@ class Command(BaseCommand):
|
||||||
user.is_active = True
|
user.is_active = True
|
||||||
user.is_staff = True
|
user.is_staff = True
|
||||||
user.is_superuser = True
|
user.is_superuser = True
|
||||||
|
if email:
|
||||||
user.email = email
|
user.email = email
|
||||||
else:
|
else:
|
||||||
print(f'Create new super user "{username}"', file=sys.stderr)
|
print(f'Create new super user "{username}"', file=sys.stderr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue