Commit 5d1dcfe0 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix addresses

parent c693af08
Pipeline #26226 passed with stages
in 2 minutes and 4 seconds
...@@ -75,11 +75,11 @@ class UpdateInstitution(Resource): ...@@ -75,11 +75,11 @@ class UpdateInstitution(Resource):
paragraph_url = f'{base_url}{extended_address_path}{element["id"]}' paragraph_url = f'{base_url}{extended_address_path}{element["id"]}'
drupal_response_address = requests.get(paragraph_url, headers=headers, auth=auth) drupal_response_address = requests.get(paragraph_url, headers=headers, auth=auth)
response_data = drupal_response_address.json()['data'] response_data = drupal_response_address.json()['data']
addresses = response_data['attributes']['field_address'] next_address = response_data['attributes']['field_address']
if addresses is not None: if next_address is not None:
addresses['coordinates'] = \ next_address['coordinates'] = \
response_data['attributes']['field_geographical_coordinates']['value'] response_data['attributes']['field_geographical_coordinates']['value']
addresses.append(addresses) addresses.append(next_address)
institution_types = [] institution_types = []
paragraph_url = \ paragraph_url = \
......
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