mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
Fix when no records returned by API (#923)
For some reason when some programs delete a record we get an entry returned with records: []
This commit is contained in:
parent
79457bdc85
commit
4ce1b71c57
@ -65,6 +65,9 @@ class Record(object):
|
||||
|
||||
rrsets=[]
|
||||
for r in jdata['rrsets']:
|
||||
if len(r['records']) == 0:
|
||||
continue
|
||||
|
||||
while len(r['comments'])<len(r['records']):
|
||||
r['comments'].append({"content": "", "account": ""})
|
||||
r['records'], r['comments'] = (list(t) for t in zip(*sorted(zip(r['records'], r['comments']), key=by_record_content_pair)))
|
||||
|
Loading…
Reference in New Issue
Block a user