Commit b929bd6f authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Check if address exists.

Make sure message is a str and not an error.
parent f4eb9a6f
Pipeline #26075 passed with stages
in 2 minutes and 26 seconds
......@@ -71,9 +71,11 @@ class MonitorDrupalJsonApiInstitution(Resource):
'extended_address/' + addressElement['id'],
headers=headers, auth=auth).json()['data']
fieldAdressess = drupalResponseAddress['attributes']['field_address']
fieldAdressess['coordinates'] = \
drupalResponseAddress['attributes']['field_geographical_coordinates']['value']
addresses.append(fieldAdressess)
if fieldAdressess is not None:
fieldAdressess['coordinates'] = \
drupalResponseAddress['attributes']['field_geographical_coordinates'][
'value']
addresses.append(fieldAdressess)
institutionTypes = []
institutionTypesParagraphsUri = \
......@@ -102,7 +104,7 @@ class MonitorDrupalJsonApiInstitution(Resource):
current_app.logger.error(msg)
return {
'status': 'FAILURE',
'message': ex,
'message': str(ex),
'topic_value': topic_value
}, 500
except Exception as ex:
......@@ -111,7 +113,7 @@ class MonitorDrupalJsonApiInstitution(Resource):
current_app.logger.error(msg)
return {
'status': 'FAILURE',
'message': ex,
'message': str(ex),
'topic_value': topic_value
}, 500
topic_value = {
......
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