Browse Source

add logging for password reset

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

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

@ -20,13 +20,13 @@ class Command(createsuperuser.Command):
try:
super().handle(*args, **options)
self.stderr.write(f'try executed')
except (IntegrityError, CommandError):
pass
self.stderr.write(f'User {username} already exists.')
if password:
database = options.get('database')
db = self.UserModel._default_manager.db_manager(database)
user = db.get(username=username)
user.set_password(password)
self.stderr.write(f'Setting password for User {username}.')
user.save()
Loading…
Cancel
Save