Skip to content

Commit

Permalink
Fixed bug with whois integration
Browse files Browse the repository at this point in the history
  • Loading branch information
drakylar committed Jan 3, 2022
1 parent e449585 commit 70b5c55
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions routes/ui/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2987,31 +2987,31 @@ def whois_page_form(project_id, current_project, current_user):
for hostname in form.hostnames.data:
whois_obj = whois.whois(hostname)
result_str = ''
if whois_obj['registrar']:
if 'registrar' in whois_obj and whois_obj['registrar']:
result_str += 'Registrar: {}\n'.format(whois_obj['registrar'])
if whois_obj['whois_server']:
if 'whois_server' in whois_obj and whois_obj['whois_server']:
result_str += 'Whois server: {}\n'.format(whois_obj['whois_server'])
if whois_obj['referral_url']:
if 'referral_url' in whois_obj and whois_obj['referral_url']:
result_str += 'Referral URL: {}\n'.format(whois_obj['referral_url'])
if whois_obj['name_servers']:
if 'name_servers' in whois_obj and whois_obj['name_servers']:
result_str += 'Name servers: \n{}\n'.format('\n'.join([' ' + x.lower() for x in set(whois_obj['name_servers'])]))
if whois_obj['emails']:
if 'emails' in whois_obj and whois_obj['emails']:
result_str += 'Emails: \n{}\n'.format('\n'.join([' ' + x for x in set(whois_obj['emails'])]))
if whois_obj['dnssec']:
if 'dnssec' in whois_obj and whois_obj['dnssec']:
result_str += 'DNSSec: {}\n'.format(whois_obj['dnssec'])
if whois_obj['name']:
if 'name' in whois_obj and whois_obj['name']:
result_str += 'Name: {}\n'.format(whois_obj['name'])
if whois_obj['org']:
if 'org' in whois_obj and whois_obj['org']:
result_str += 'Organization: {}\n'.format(whois_obj['org'])
if whois_obj['address']:
if 'address' in whois_obj and whois_obj['address']:
result_str += 'Address: {}\n'.format(whois_obj['address'])
if whois_obj['city']:
if 'city' in whois_obj and whois_obj['city']:
result_str += 'DNSSec: {}\n'.format(whois_obj['city'])
if whois_obj['state']:
if 'state' in whois_obj and whois_obj['state']:
result_str += 'State: {}\n'.format(whois_obj['state'])
if whois_obj['zipcode']:
if 'zipcode' in whois_obj and whois_obj['zipcode']:
result_str += 'Zipcode: {}\n'.format(whois_obj['zipcode'])
if whois_obj['country']:
if 'country' in whois_obj and whois_obj['country']:
result_str += 'Country: {}\n'.format(whois_obj['country'])

# add even with result_str is empty
Expand Down

0 comments on commit 70b5c55

Please sign in to comment.