Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy fix publiline #187

Open
wants to merge 1 commit into
base: prod
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions modules/websubmit/web/publiline.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of Invenio.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2016 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 @@ -350,8 +350,7 @@ def __displayDocument(req, doctype, categ, RN, send, ln = CFG_SITE_LANG):
else:
# Was not found in the pending directory. Already approved?
try:
(authors, title, sysno) = getInfo(RN)
newrn = RN
(authors, title, sysno, newrn) = getInfo(RN)
if sysno is None:
return _("Unable to display document.")
except:
Expand Down Expand Up @@ -1509,7 +1508,7 @@ def get_brief_doc_details_from_repository(reportnumber):
def getInfo(RN):
"""
Retrieve basic info from record with given report number.
Returns (authors, title, sysno)
Returns (authors, title, sysno, newrn)
"""
authors = None
title = None
Expand All @@ -1520,8 +1519,13 @@ def getInfo(RN):
sysno = int(recids.tolist()[0])
authors = ','.join(get_fieldvalues(sysno, "100__a") + get_fieldvalues(sysno, "700__a"))
title = ','.join(get_fieldvalues(sysno, "245__a"))

return (authors, title, sysno)
#special case for CERN
if RN.startswith('ATL'):
try:
newrn = get_fieldvalues(list(search_pattern(p=RN, f='088'))[0], '037__a')[0]
except:
newrn = RN
return (authors, title, sysno, newrn)

#seek info in pending directory
def getInPending(doctype, categ, RN):
Expand Down