Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
Merge pull request #488 from tsgit/fix_doi_linker
Browse files Browse the repository at this point in the history
DocExtract: fix find_doi in linker
  • Loading branch information
tsgit authored May 7, 2019
2 parents 7e60941 + 60a8d71 commit 5d86b7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/docextract/lib/refextract_linker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2019 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -73,6 +73,8 @@ def find_reportnumber(citation_element):

def find_doi(citation_element):
doi_string = citation_element['doi_string']
if doi_string.lower().startswith(('doi:', 'hdl:')) and len(doi_string) > 4:
doi_string = doi_string[4:]
recids = get_recids_matching_query(doi_string, 'doi')
return recids if len(recids) == 1 else []

Expand Down

0 comments on commit 5d86b7f

Please sign in to comment.