1
0
mirror of https://gitlab.crans.org/bde/nk20-scripts synced 2025-06-29 17:51:08 +02:00

Adapt verbosity of some scripts

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
2021-04-14 15:18:24 +02:00
parent 13322189dc
commit cf8b05d20a
5 changed files with 20 additions and 15 deletions

View File

@ -16,7 +16,11 @@ class Command(BaseCommand):
user = User.objects.get(username=uname)
user.is_active = True
if kwargs['STAFF']:
if kwargs['verbosity'] > 0:
self.stdout.write(f"Add {user} to staff users...")
user.is_staff = True
if kwargs['SUPER']:
if kwargs['verbosity'] > 0:
self.stdout.write(f"Add {user} to superusers...")
user.is_superuser = True
user.save()