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
8993142a
Commit
8993142a
authored
Jan 11, 2016
by
LE GAC Renaud
Browse files
Better implementation of the fix for duplicate_conference.
parent
661debf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
modules/callbacks.py
modules/callbacks.py
+1
-1
modules/check_tools.py
modules/check_tools.py
+7
-6
No files found.
modules/callbacks.py
View file @
8993142a
...
...
@@ -157,7 +157,7 @@ def INHIBIT_DUPLICATE_PUBLICATION(publication):
get_id
(
db
.
categories
,
code
=
'COM'
))
if
id_category
in
id_cats
:
ids
=
duplicate_conference
(
publication
)
ids
=
duplicate_conference
(
publication
,
id_category
!=
id_cats
[
2
]
)
if
ids
:
db
.
publications
[
CALLBACK_ERRORS
]
=
[
...
...
modules/check_tools.py
View file @
8993142a
...
...
@@ -8,7 +8,6 @@ import regex
from
gluon
import
current
from
plugin_dbui
import
(
UNDEF
,
UNDEF_ID
,
get_id
,
get_where_query
)
...
...
@@ -166,7 +165,8 @@ def check_publication(row):
text
=
T
(
"Conference speaker is missing"
)
li
.
append
(
text
)
ids
=
duplicate_conference
(
row
.
publications
)
ids
=
duplicate_conference
(
row
.
publications
,
row
.
categories
.
usual
==
'proceeding'
)
if
ids
:
idset
=
idset
.
union
(
ids
)
text
=
T
(
"Possible duplicate entries"
)
...
...
@@ -262,7 +262,7 @@ def duplicate_article(publication):
return
ids
def
duplicate_conference
(
publication
):
def
duplicate_conference
(
publication
,
proceeding
=
False
):
"""Look for duplicate talk / proceeding.
The comparison is performed on conference talk/proceeding published
...
...
@@ -275,6 +275,7 @@ def duplicate_conference(publication):
Args:
publication (dict or gluon.storage.Storage): contains the publication
fields and theirs values.
proceeding (bool): tag the publication either as talk or a proceeding.
Returns:
list: list of *ids* corresponding to duplicate entries.
...
...
@@ -286,11 +287,11 @@ def duplicate_conference(publication):
categories
=
db
.
categories
publications
=
db
.
publications
if
p
ublications
.
id_categories
==
get_id
(
db
.
categories
,
code
=
'COM'
)
:
qcat
=
categories
.
code
==
'
COM'
if
p
roceeding
:
qcat
=
(
categories
.
code
==
'
ACTI'
)
|
(
categories
.
code
==
'ACTN'
)
else
:
qcat
=
(
categories
.
code
==
'
ACTI'
)
|
(
categories
.
code
==
'ACTN'
)
qcat
=
categories
.
code
==
'
COM'
qmain
=
get_where_query
(
publications
)
qmain
&=
qcat
...
...
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