mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 23:20:27 +00:00
fix: User role was not assigned upon creation (#860)
This commit is contained in:
parent
2917c47fd1
commit
2c18e5c88f
@ -431,6 +431,7 @@ class User(db.Model):
|
|||||||
return {'status': False, 'msg': 'Email address is already in use'}
|
return {'status': False, 'msg': 'Email address is already in use'}
|
||||||
|
|
||||||
# first register user will be in Administrator role
|
# first register user will be in Administrator role
|
||||||
|
if self.role_id is None:
|
||||||
self.role_id = Role.query.filter_by(name='User').first().id
|
self.role_id = Role.query.filter_by(name='User').first().id
|
||||||
if User.query.count() == 0:
|
if User.query.count() == 0:
|
||||||
self.role_id = Role.query.filter_by(
|
self.role_id = Role.query.filter_by(
|
||||||
|
@ -845,7 +845,7 @@ def api_add_account_user(account_id, user_id):
|
|||||||
user.username, account.name))
|
user.username, account.name))
|
||||||
|
|
||||||
history = History(
|
history = History(
|
||||||
msg='Revoke {} user privileges on {}'.format(
|
msg='Add {} user privileges on {}'.format(
|
||||||
user.username, account.name),
|
user.username, account.name),
|
||||||
created_by=current_user.username)
|
created_by=current_user.username)
|
||||||
history.add()
|
history.add()
|
||||||
|
Loading…
Reference in New Issue
Block a user