fix: Bad call to get_asn_descriptions, typo.

pull/12/head
Raphaël Vinot 2019-03-15 18:20:52 +01:00
parent 7694c119cd
commit aeb90e6c5f
1 changed files with 6 additions and 5 deletions

View File

@ -179,13 +179,14 @@ def ipasn():
response = ipasn.query(first=(date.today() - timedelta(days=60)).isoformat(), response = ipasn.query(first=(date.today() - timedelta(days=60)).isoformat(),
aggregate=True, ip=ip) aggregate=True, ip=ip)
for r in response['response']: for r in response['response']:
r['asn_description'] = [] r['asn_descriptions'] = []
asn_descriptions = q.get_asn_descriptions(asn=r['asn'], all_descriptions=True) asn_descriptions = q.get_asn_descriptions(asn=r['asn'], all_descriptions=True)['response']
for timestamp in sorted(asn_descriptions.keys()): for timestamp in sorted(asn_descriptions.keys()):
if r['first_seen'] <= timestamp <= r['last_seen']: if r['first_seen'] <= timestamp <= r['last_seen']:
r['asn_description'].append(asn_descriptions[timestamp]) r['asn_descriptions'].append(asn_descriptions[timestamp])
if not r['asn_description'] and timestamp <= r['last_seen']:
r['asn_description'].append(asn_descriptions[timestamp]) if not r['asn_descriptions'] and timestamp <= r['last_seen']:
r['asn_descriptions'].append(asn_descriptions[timestamp])
return render_template('ipasn.html', ipasn_details=response['response'], return render_template('ipasn.html', ipasn_details=response['response'],
**response['meta']) **response['meta'])