Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
limbra
limbra
Commits
813338e7
Commit
813338e7
authored
Jan 25, 2021
by
LE GAC Renaud
Browse files
Update check_my_affiliations to improve error reporting
parent
46ee3ddc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
1 deletion
+27
-1
languages/fr-fr.py
languages/fr-fr.py
+1
-0
modules/store_tools/__init__.py
modules/store_tools/__init__.py
+1
-0
modules/store_tools/base.py
modules/store_tools/base.py
+4
-0
modules/store_tools/recordheppubli.py
modules/store_tools/recordheppubli.py
+5
-0
tests/issues/test_50_acl.py
tests/issues/test_50_acl.py
+16
-1
No files found.
languages/fr-fr.py
View file @
813338e7
...
...
@@ -564,6 +564,7 @@
'Regular expression defining the name of our institute.'
:
'Expression régulière definissant le nom de votre laboratoire.'
,
'Reject'
:
'Rejeter'
,
'Reject %s is not defined'
:
"Rejeté %s n'est pas défini"
,
'Reject affiliations are not defined for all authors'
:
"Rejeté les affiliations ne sont pas défini pour tous les auteurs"
,
'Reject article is not published'
:
"Rejeté l'article n'est pas publié"
,
'Reject collaboration is not defined'
:
"Rejeté la collaboration n'est pas définie"
,
'Reject collaboration is not well formed'
:
'Rejeté la collaboration est mal formatté'
,
...
...
modules/store_tools/__init__.py
View file @
813338e7
...
...
@@ -10,6 +10,7 @@ from .base import (ARXIV,
is_conference
,
is_institute
,
is_thesis
,
MSG_NO_AFFILIATION_FOR_ALL
,
MSG_NO_CONF
,
MSG_NO_COUNTRY
,
MSG_NO_ENTRY
,
...
...
modules/store_tools/base.py
View file @
813338e7
...
...
@@ -15,6 +15,10 @@ INS = ("inspirehep", "inspirehep.net")
MSG_INV_CONF
=
"Reject invalid conference information"
MSG_INV_CONF_KEY
=
"Reject invalid conference key"
MSG_NO_AFFILIATION_FOR_ALL
=
\
"Reject affiliations are not defined for all authors"
MSG_NO_CONF
=
"Reject no conference information"
MSG_NO_CONF_DATE
=
"Reject no conference date"
MSG_NO_CONF_ID_KEY
=
"Reject no conference identifier and key"
...
...
modules/store_tools/recordheppubli.py
View file @
813338e7
...
...
@@ -6,6 +6,7 @@ import pprint
from
.authorsmixin
import
AuthorsMixin
,
MSG_NO_MY_AUTHOR
from
.base
import
(
search_synonym
,
MSG_NO_AFFILIATION_FOR_ALL
,
MSG_UNKNOWN_COLLABORATION
,
MSG_WELL_FORMED_DATE
,
REG_DATE_YYYYMM
,
...
...
@@ -265,6 +266,10 @@ class RecordHepPubli(dict, AuthorsMixin, PublicationInfoMixin):
return
self
.
logger
.
debug
(
f
"
{
T6
}
check my affiliation"
)
if
not
self
.
is_affiliation_for_all
():
raise
CheckException
(
MSG_NO_AFFILIATION_FOR_ALL
)
value
=
self
.
find_affiliation
(
rex_institute
)
if
len
(
value
)
==
0
:
...
...
tests/issues/test_50_acl.py
View file @
813338e7
...
...
@@ -5,7 +5,8 @@
import
pytest
from
gluon
import
current
from
store_tools
import
load_record
,
ToolException
from
harvest_tools
import
get_rex_institute
from
store_tools
import
CheckException
,
load_record
,
ToolException
def
test_acl_cds1513204_50001
():
...
...
@@ -245,3 +246,17 @@ def test_acl_ins1386663_50011():
assert
authors
[
0
]
==
u
"S. Adrián-Martínez"
assert
authors
[
128
]
==
u
"J. D. Zornoza"
assert
authors
[
139
]
==
u
"D. M. Coward"
def
test_acl_ins1808873_50012
():
"""
JSON 210125:
* No affiliations
"""
record
=
load_record
(
"inspirehep.net"
,
1808873
,
shelf
=
"literature"
)
rex_institute
=
get_rex_institute
(
current
.
db
,
current
.
app
)
with
pytest
.
raises
(
CheckException
):
record
.
check_my_affiliation
(
rex_institute
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment