mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 23:20:27 +00:00
routes/admin.py: DetailedHistory: backward-compatibility
See https://github.com/ngoduykhanh/PowerDNS-Admin/pull/1066
This commit is contained in:
parent
f0008ce401
commit
737e1fb93b
@ -844,7 +844,7 @@ class DetailedHistory():
|
|||||||
keyname=DetailedHistory.get_key_val(detail_dict, "key"),
|
keyname=DetailedHistory.get_key_val(detail_dict, "key"),
|
||||||
rolename=DetailedHistory.get_key_val(detail_dict, "role"),
|
rolename=DetailedHistory.get_key_val(detail_dict, "role"),
|
||||||
description=DetailedHistory.get_key_val(detail_dict, "description"),
|
description=DetailedHistory.get_key_val(detail_dict, "description"),
|
||||||
linked_domains=DetailedHistory.get_key_val(detail_dict, "domains"),
|
linked_domains=DetailedHistory.get_key_val(detail_dict, "domains" if "domains" in detail_dict else "domain_acl"),
|
||||||
linked_accounts=DetailedHistory.get_key_val(detail_dict, "accounts"))
|
linked_accounts=DetailedHistory.get_key_val(detail_dict, "accounts"))
|
||||||
|
|
||||||
elif 'Delete API key' in history.msg:
|
elif 'Delete API key' in history.msg:
|
||||||
@ -886,7 +886,7 @@ class DetailedHistory():
|
|||||||
# check for lower key as well for old databases
|
# check for lower key as well for old databases
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_key_val(_dict, key):
|
def get_key_val(_dict, key):
|
||||||
return _dict.get(key, _dict.get(key.lower(), ''))
|
return str(_dict.get(key, _dict.get(key.title(), '')))
|
||||||
|
|
||||||
|
|
||||||
# convert a list of History objects into DetailedHistory objects
|
# convert a list of History objects into DetailedHistory objects
|
||||||
|
Loading…
Reference in New Issue
Block a user