Apply ESI endpoint changes (#719)

And some more logging so the problem is obvious next time
This commit is contained in:
Basraah 2017-02-15 14:07:03 +10:00 committed by Adarnof
parent 3af1a6a1fb
commit dfd416c38d

View File

@ -211,15 +211,14 @@ def click_fatlink_view(request, token, hash, fatname):
ship = c.Location.get_characters_character_id_ship(character_id=token.character_id).result() ship = c.Location.get_characters_character_id_ship(character_id=token.character_id).result()
location['solar_system_name'] = \ location['solar_system_name'] = \
c.Universe.get_universe_systems_system_id(system_id=location['solar_system_id']).result()[ c.Universe.get_universe_systems_system_id(system_id=location['solar_system_id']).result()[
'solar_system_name'] 'name']
if location['structure_id']: if location['structure_id']:
location['station_name'] = \ location['station_name'] = \
c.Universe.get_universe_structures_structure_id(structure_id=location['structure_id']).result()[ c.Universe.get_universe_structures_structure_id(structure_id=location['structure_id']).result()[
'name'] 'name']
elif location['station_id']: elif location['station_id']:
location['station_name'] = \ location['station_name'] = \
c.Universe.get_universe_stations_station_id(station_id=location['station_id']).result()[ c.Universe.get_universe_stations_station_id(station_id=location['station_id']).result()['name']
'station_name']
else: else:
location['station_name'] = "No Station" location['station_name'] = "No Station"
ship['ship_type_name'] = EveManager.get_itemtype(ship['ship_type_id']).name ship['ship_type_name'] = EveManager.get_itemtype(ship['ship_type_id']).name
@ -247,6 +246,7 @@ def click_fatlink_view(request, token, hash, fatname):
else: else:
messages.error(request, _('FAT link has expired.')) messages.error(request, _('FAT link has expired.'))
except (ObjectDoesNotExist, KeyError): except (ObjectDoesNotExist, KeyError):
logger.exception("Failed to process FAT link.")
messages.error(request, _('Invalid FAT link.')) messages.error(request, _('Invalid FAT link.'))
return redirect('auth_fatlink_view') return redirect('auth_fatlink_view')