SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit e8be64a0 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Fix parser error on non-200 reponse

parent c908730b
No related branches found
No related tags found
No related merge requests found
...@@ -649,6 +649,10 @@ def harvest_citedby_links(request, doi_label): ...@@ -649,6 +649,10 @@ def harvest_citedby_links(request, doi_label):
'qdata': query_xml, 'qdata': query_xml,
'doi': publication.doi_string, } 'doi': publication.doi_string, }
r = requests.post(url, params=params,) r = requests.post(url, params=params,)
if r.status_code == 401:
messages.warning(request, ('<h3>Crossref credentials are invalid.</h3>'
'Please contact the SciPost Admin.'))
return redirect(publication.get_absolute_url())
response_headers = r.headers response_headers = r.headers
response_text = r.text response_text = r.text
response_deserialized = ET.fromstring(r.text) response_deserialized = ET.fromstring(r.text)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment