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
1d0e1e1d
Commit
1d0e1e1d
authored
Apr 12, 2021
by
Jonas Waeber
Browse files
Use correct id.
parent
b4384122
Changes
1
Hide whitespace changes
Inline
Side-by-side
import_api_app/resources/WriteTypeReportToDrupal.py
View file @
1d0e1e1d
...
...
@@ -80,7 +80,7 @@ def get_node_id(memobase_id: str, node_type: str):
response
=
requests
.
get
(
url
,
headers
=
headers
)
if
response
.
ok
:
try
:
return
response
.
json
()[
'data'
][
0
][
'attributes'
][
'id'
]
return
response
.
json
()[
'data'
][
0
][
'attributes'
][
'
drupal_internal__n
id'
]
except
KeyError
as
er
:
current_app
.
logger
.
error
(
f
"Could not find the key
{
er
}
in data:
{
response
.
text
}
."
)
raise
ImportApiError
(
f
"Could not find the key
{
er
}
in data (url=
{
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