Commit ed096c68 authored by Matthias's avatar Matthias
Browse files

add fields in fr and it for institution

parent c2bdafb0
Pipeline #12291 passed with stages
in 5 minutes and 20 seconds
...@@ -45,10 +45,18 @@ class MonitorDrupalJsonApiInstitution(Resource): ...@@ -45,10 +45,18 @@ class MonitorDrupalJsonApiInstitution(Resource):
drupalResponse =\ drupalResponse =\
requests.get('https://mb-wf1.memobase.unibas.ch/jsonapi/node/' + requests.get('https://mb-wf1.memobase.unibas.ch/jsonapi/node/' +
'institution/' + institutionId).json()['data'] 'institution/' + institutionId).json()['data']
drupalResponse_fr =\
requests.get('https://mb-wf1.memobase.unibas.ch/fr/jsonapi/node/' +
'institution/' + institutionId).json()['data']
drupalResponse_it =\
requests.get('https://mb-wf1.memobase.unibas.ch/it/jsonapi/node/' +
'institution/' + institutionId).json()['data']
topicValue = { topicValue = {
'type': drupalResponse['type'], 'type': drupalResponse['type'],
'status': drupalResponse['attributes']['status'], 'status': drupalResponse['attributes']['status'],
'title': drupalResponse['attributes']['title'], 'title': drupalResponse['attributes']['title'],
'title_fr': drupalResponse_fr['attributes']['title'],
'title_it': drupalResponse_it['attributes']['title'],
'field_address': drupalResponse['attributes']['field_address'], 'field_address': drupalResponse['attributes']['field_address'],
'field_isil': drupalResponse['attributes']['field_isil'], 'field_isil': drupalResponse['attributes']['field_isil'],
'field_memobase_id': drupalResponse['attributes']['field_memobase_id'], 'field_memobase_id': drupalResponse['attributes']['field_memobase_id'],
...@@ -56,7 +64,9 @@ class MonitorDrupalJsonApiInstitution(Resource): ...@@ -56,7 +64,9 @@ class MonitorDrupalJsonApiInstitution(Resource):
'field_website': drupalResponse['attributes']['field_website'], 'field_website': drupalResponse['attributes']['field_website'],
'field_link_archive_catalog': 'field_link_archive_catalog':
drupalResponse['attributes']['field_link_archive_catalog'], drupalResponse['attributes']['field_link_archive_catalog'],
'field_text': drupalResponse['attributes']['field_text'] 'field_text': drupalResponse['attributes']['field_text'],
'field_text_fr': drupalResponse_fr['attributes']['field_text'],
'field_text_it': drupalResponse_it['attributes']['field_text']
} }
except Exception as ex: except Exception as ex:
report += 'Exception: ' + str(ex) + '\n' report += 'Exception: ' + str(ex) + '\n'
......
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