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:
Mark Zealey 2021-10-30 22:07:42 +03:00 committed by GitHub
parent 79457bdc85
commit 4ce1b71c57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)))