mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-01-07 19:05:39 +00:00
Merge pull request #275 from tmuncks/dont-revoke-your-own-rights
Fix user deletion
This commit is contained in:
commit
ecdb9b9328
@ -1101,9 +1101,9 @@ def admin_manageuser():
|
|||||||
data = jdata['data']
|
data = jdata['data']
|
||||||
|
|
||||||
if jdata['action'] == 'delete_user':
|
if jdata['action'] == 'delete_user':
|
||||||
if username == current_user.username:
|
|
||||||
return make_response(jsonify( { 'status': 'error', 'msg': 'You cannot delete yourself.' } ), 400)
|
|
||||||
user = User(username=data)
|
user = User(username=data)
|
||||||
|
if user.username == current_user.username:
|
||||||
|
return make_response(jsonify( { 'status': 'error', 'msg': 'You cannot delete yourself.' } ), 400)
|
||||||
result = user.delete()
|
result = user.delete()
|
||||||
if result:
|
if result:
|
||||||
history = History(msg='Delete username {0}'.format(data), created_by=current_user.username)
|
history = History(msg='Delete username {0}'.format(data), created_by=current_user.username)
|
||||||
|
Loading…
Reference in New Issue
Block a user