Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 661debf1 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Seperate processing for COM and ACTI in duplicate_conference

parent 581a965b
...@@ -8,6 +8,7 @@ import regex ...@@ -8,6 +8,7 @@ import regex
from gluon import current from gluon import current
from plugin_dbui import (UNDEF, from plugin_dbui import (UNDEF,
UNDEF_ID, UNDEF_ID,
get_id,
get_where_query) get_where_query)
...@@ -285,36 +286,34 @@ def duplicate_conference(publication): ...@@ -285,36 +286,34 @@ def duplicate_conference(publication):
categories = db.categories categories = db.categories
publications = db.publications publications = db.publications
qcat = (categories.code == 'ACTI') | \ if publications.id_categories == get_id(db.categories, code='COM'):
(categories.code == 'ACTN') | \ qcat = categories.code == 'COM'
(categories.code == 'COM')
else:
qcat = (categories.code == 'ACTI') | (categories.code == 'ACTN')
qmain = get_where_query(publications) qmain = get_where_query(publications)
qmain = ((qmain) & (qcat)) qmain &= qcat
qmain = ((qmain) & (publications.id_teams == publication['id_teams'])) qmain &= publications.id_teams == publication['id_teams']
qmain = ((qmain) & (publications.title == publication['title'])) qmain &= publications.title == publication['title']
if 'id' in publication and publication['id']: if 'id' in publication and publication['id']:
qmain = ((qmain) & (publications.id != publication['id'])) qmain &= publications.id != publication['id']
# title, conference title, conference date and conference town # title, conference title, conference date and conference town
qtitle = publications.conference_title == publication['conference_title'] qtitle = publications.conference_title == publication['conference_title']
qdates = publications.conference_dates == publication['conference_dates'] qdates = publications.conference_dates == publication['conference_dates']
qtown = publications.conference_town == publication['conference_town'] qtown = publications.conference_town == publication['conference_town']
query = ((qmain) & (qtitle)) query = ((qmain) & (qtitle) & (qdates) & (qtown))
query = ((query) & (qdates))
query = ((query) & (qtown))
extend_ids(db, query, ids) extend_ids(db, query, ids)
# title, conference date and conference town # title, conference date and conference town
query = ((query) & (qdates)) query = ((qmain) & (qdates) & (qtown))
query = ((query) & (qtown))
extend_ids(db, query, ids) extend_ids(db, query, ids)
# title, conference title and conference town # title, conference title and conference town
query = ((qmain) & (qtitle)) query = ((qmain) & (qtitle) & (qtown))
query = ((query) & (qtown))
extend_ids(db, query, ids) extend_ids(db, query, ids)
return ids return ids
......
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