mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40: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"),
|
||||
rolename=DetailedHistory.get_key_val(detail_dict, "role"),
|
||||
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"))
|
||||
|
||||
elif 'Delete API key' in history.msg:
|
||||
@ -886,7 +886,7 @@ class DetailedHistory():
|
||||
# check for lower key as well for old databases
|
||||
@staticmethod
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user