mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-01-07 19:05:39 +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=[]
|
rrsets=[]
|
||||||
for r in jdata['rrsets']:
|
for r in jdata['rrsets']:
|
||||||
|
if len(r['records']) == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
while len(r['comments'])<len(r['records']):
|
while len(r['comments'])<len(r['records']):
|
||||||
r['comments'].append({"content": "", "account": ""})
|
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)))
|
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