Skip to content

Commit

Permalink
Raise exception if given argument is not an orcid
Browse files Browse the repository at this point in the history
  • Loading branch information
orviz committed Oct 3, 2024
1 parent ebd90f6 commit 880f8ba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,8 @@ def orcid_basic_info(orcid):
"Authorization": "Bearer a354d82e-37fa-47de-b4a2-740dbe90f355",
}
try:
if not idutils.is_orcid(orcid):
raise Exception("Malformed ORCID value: %s" % orcid)
url = "https://pub.orcid.org/v3.0/" + orcid
r = requests.get(url, verify=False, headers=headers) # GET with headers
xmlTree = ET.fromstring(r.text)
Expand Down

0 comments on commit 880f8ba

Please sign in to comment.