Browse Source

catch exception commanderror to avoid 'that username is already taken' in startup

pull/787/head
Christian Gill 4 years ago
parent
commit
13a3ec4ef4
1 changed files with 2 additions and 0 deletions
  1. 2
      app/server/management/commands/create_admin.py

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

@ -22,6 +22,8 @@ class Command(createsuperuser.Command):
super().handle(*args, **options)
except IntegrityError:
self.stderr.write(f'User {username} already exists.')
except CommandError:
pass
if password:
database = options.get('database')

Loading…
Cancel
Save