Browse Source

join errors to one exception

pull/787/head
Christian Gill 4 years ago
parent
commit
2581f8ab4d
1 changed files with 2 additions and 3 deletions
  1. 5
      app/server/management/commands/create_admin.py

5
app/server/management/commands/create_admin.py

@ -20,10 +20,9 @@ class Command(createsuperuser.Command):
try:
super().handle(*args, **options)
except IntegrityError:
self.stderr.write(f'try executed')
except (IntegrityError, CommandError) as e:
self.stderr.write(f'User {username} already exists.')
except CommandError:
pass
if password:
database = options.get('database')

Loading…
Cancel
Save