Commit 3a60a4c0 authored by Vladimir Mencl's avatar Vladimir Mencl Committed by Zenon Mousmoulas
Browse files

AllServicePoints: fix JSON export missing data

The get_all_services() view is missing the 'name' key from the exported JSON entries.

This got (presumably accidentally) introduced in 7f1f9f3b.

The 'name' now gets exported only if the 'inst' export threw an exception.

Fix the export for 'inst' and 'name' keys to consistently try the current
language, then 'en', then set the value to 'unknown'
parent 03c0a5ad
......@@ -1529,6 +1529,13 @@ def get_all_services(request):
response_location['inst'] = sl.institutionid.org_name.get(
except Name_i18n.DoesNotExist:
response_location['inst'] = sl.institutionid.org_name.get(lang='en').name
except Name_i18n.DoesNotExist:
response_location['inst'] = 'unknown'
response_location['name'] = sl.loc_name.get(lang=lang).name
except Name_i18n.DoesNotExist:
response_location['name'] = sl.loc_name.get(lang='en').name
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment