mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-01-06 10:25:40 +00:00
Fix user deletion
An improper check causes problems when trying to delete a user. This fixes that error. (cherry picked from commit 3c838cc0e4a2d4904d0fc919fb88c58ebd4fe4bd)
This commit is contained in:
parent
ccec6c37b4
commit
90f08ee92e
@ -1098,9 +1098,9 @@ def admin_manageuser():
|
||||
data = jdata['data']
|
||||
|
||||
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)
|
||||
if user.username == current_user.username:
|
||||
return make_response(jsonify( { 'status': 'error', 'msg': 'You cannot delete yourself.' } ), 400)
|
||||
result = user.delete()
|
||||
if result:
|
||||
history = History(msg='Delete username {0}'.format(data), created_by=current_user.username)
|
||||
|
Loading…
Reference in New Issue
Block a user