Commit ee6f8b28 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update wizards.update_citations to use 'citation_count'

parent a1568400
......@@ -437,10 +437,10 @@ def update_citations():
from json.decoder import JSONDecodeError
from reporting_tools import repr_team_project
from store_tools import CdsException, InvenioStore
from store_tools import CdsException, InspirehepStore
today =
rex_ins = re.compile(r"https?://\d+)")
rex_ins = re.compile(r"\d+)")
citations = db.citations
publications = db.publications
......@@ -461,7 +461,7 @@ def update_citations():
query = selector.query(publications)
# get the number of citation and update the database table
store = InvenioStore("", shelf="literature")
store = InspirehepStore("", shelf="literature")
for row in db(query).iterselect(, publications.origin):
counters.article += 1
......@@ -470,15 +470,15 @@ def update_citations():
# interrogate
recid =
count = store.get_field(recid, "number_of_citations")
count = store.get_field(recid, "citation_count")
except AttributeError:
logger.warning(f"record identifier not found in {row.origin}")
counters.recid += 1
except CdsException:
logger.warning(f"failed to get citations for {recid}")
except CdsException as e:
logger.warning(f"failed to get citations for {recid}: {e}")
counters.failed += 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment