Due to a scheduled upgrade to version 14.10, GitLab will be unavailabe on Monday 30.05., from 19:00 until 20:00.

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): ...@@ -71,9 +71,11 @@ class MonitorDrupalJsonApiInstitution(Resource):
'extended_address/' + addressElement['id'], 'extended_address/' + addressElement['id'],
headers=headers, auth=auth).json()['data'] headers=headers, auth=auth).json()['data']
fieldAdressess = drupalResponseAddress['attributes']['field_address'] fieldAdressess = drupalResponseAddress['attributes']['field_address']
fieldAdressess['coordinates'] = \ if fieldAdressess is not None:
drupalResponseAddress['attributes']['field_geographical_coordinates']['value'] fieldAdressess['coordinates'] = \
addresses.append(fieldAdressess) drupalResponseAddress['attributes']['field_geographical_coordinates'][
'value']
addresses.append(fieldAdressess)
institutionTypes = [] institutionTypes = []
institutionTypesParagraphsUri = \ institutionTypesParagraphsUri = \
...@@ -102,7 +104,7 @@ class MonitorDrupalJsonApiInstitution(Resource): ...@@ -102,7 +104,7 @@ class MonitorDrupalJsonApiInstitution(Resource):
current_app.logger.error(msg) current_app.logger.error(msg)
return { return {
'status': 'FAILURE', 'status': 'FAILURE',
'message': ex, 'message': str(ex),
'topic_value': topic_value 'topic_value': topic_value
}, 500 }, 500
except Exception as ex: except Exception as ex:
...@@ -111,7 +113,7 @@ class MonitorDrupalJsonApiInstitution(Resource): ...@@ -111,7 +113,7 @@ class MonitorDrupalJsonApiInstitution(Resource):
current_app.logger.error(msg) current_app.logger.error(msg)
return { return {
'status': 'FAILURE', 'status': 'FAILURE',
'message': ex, 'message': str(ex),
'topic_value': topic_value 'topic_value': topic_value
}, 500 }, 500
topic_value = { 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