Fix error in None handling of unknown city/country in filtered users
This commit is contained in:
parent
cce8c75118
commit
242bb6cabe
|
@ -85,8 +85,13 @@ class IWLADisplayFilterUsers(IPlugin):
|
||||||
ip_title = '%s [%s]' % (hits[ip]['remote_addr'], ip)
|
ip_title = '%s [%s]' % (hits[ip]['remote_addr'], ip)
|
||||||
location = filtered_user.get('geo_location', {})
|
location = filtered_user.get('geo_location', {})
|
||||||
if location:
|
if location:
|
||||||
location_str = '(%s/%s)' % (location.get('city', unknown), location.get('countryname', unknown))
|
city = location.get('city', unknown)
|
||||||
ip_title = f'{ip_title}<br/>{location_str}'
|
country = location.get('countryname', unknown)
|
||||||
|
if not city: city = unknown
|
||||||
|
if not country: country = unknown
|
||||||
|
# At least, one information
|
||||||
|
if city != unknown or country != unknown:
|
||||||
|
ip_title = f'{ip_title}<br/>({city}/{country})'
|
||||||
table.appendRow([f'<b>{ip_title}</b>', '', ''])
|
table.appendRow([f'<b>{ip_title}</b>', '', ''])
|
||||||
table.setCellCSSClass(row, 0, '')
|
table.setCellCSSClass(row, 0, '')
|
||||||
for r in hits[ip]['requests'][::-1]:
|
for r in hits[ip]['requests'][::-1]:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user