Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Import Process
Import API
Commits
5d1dcfe0
Commit
5d1dcfe0
authored
May 11, 2021
by
Jonas Waeber
Browse files
Fix addresses
parent
c693af08
Pipeline
#26226
passed with stages
in 2 minutes and 4 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
import_api_app/resources/UpdateInstitution.py
View file @
5d1dcfe0
...
...
@@ -75,11 +75,11 @@ class UpdateInstitution(Resource):
paragraph_url
=
f
'
{
base_url
}{
extended_address_path
}{
element
[
"id"
]
}
'
drupal_response_address
=
requests
.
get
(
paragraph_url
,
headers
=
headers
,
auth
=
auth
)
response_data
=
drupal_response_address
.
json
()[
'data'
]
address
es
=
response_data
[
'attributes'
][
'field_address'
]
if
address
es
is
not
None
:
address
es
[
'coordinates'
]
=
\
next_
address
=
response_data
[
'attributes'
][
'field_address'
]
if
next_
address
is
not
None
:
next_
address
[
'coordinates'
]
=
\
response_data
[
'attributes'
][
'field_geographical_coordinates'
][
'value'
]
addresses
.
append
(
address
es
)
addresses
.
append
(
next_
address
)
institution_types
=
[]
paragraph_url
=
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment