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

Commit 12e8cbb6 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch '93-fix-bugs' into 'master'

Resolve "fix bugs"

Closes #93

See merge request !95
parents 3b693acb cbd344db
--------------------------------- CHANGELOG ----------------------------------
HEAD
- Require plugin_dbui 0.9.9.0 or higher.
- More strict rule to select affiliation.
- Add a Go button in filter associated to grid.
- Restore the user role.
- Unlock authors_roles
0.9.7.0 (Oct 2017)
- Require plugin_dbui 0.9.8.3 or higher.
- Increase the length of the field harvesters.collections to 1024
- Increase the length of the field harvesters.collections to 1024
instead of 255.
- Change the rule for the field harvesters.collections. It now contains
- Change the rule for the field harvesters.collections. It now contains
the definiton for a single collection (it was possible to define several
collection separated by a comma but this confict with author encoding).
- Fix several bugs in the documentation and in the wizard harvesters.
......
......@@ -65,7 +65,7 @@ def index():
li = [el for el in section.orderby]
field = db.publications[section.sort_field]
if section.direction == "DESC":
if section.direction == "DESC":
field = ~field
li.append(field)
......
......@@ -573,7 +573,7 @@
'Rejected': 'Rejeté',
"Rejeté la chaine XML n'est pas correcte": "Rejeté la chaine XML n'est pas correcte",
'relation harvesters / categories': 'relation moissoneurs / catégories',
'Relation team / projects': 'Relation équipe / projets',
'relation team / projects': 'relation équipe / projets',
'relation user / groups': 'relation utilisateur / groupes',
'Removing affiliation failed. Rules might be missing for the given string. Contact the author.': 'Removing affiliation failed. Rules might be missing for the given string. Contact the author.',
'Render': 'Moteur de rendu',
......
......@@ -110,23 +110,28 @@ class CheckAndFix(object):
app = current.app
reg_institute = app.reg_institute
# regular expression for the affiliation is not defined
# build it using the affiliation keys.
# regular expression for the affiliation keys
# protect special character
# add start and end of string for an exact match
if not reg_institute:
iterselect = db(db.affiliation_keys.id > 0).iterselect()
reg_institute = \
u"|".join(imap(
lambda row: u"%(key_u)s%(key_v)s" % row, iterselect))
lst = []
for row in db(db.affiliation_keys.id > 0).iterselect():
val = row.key_u
# protect special character
reg_institute = (reg_institute
.replace("(", "\\(")
.replace(")", "\\)")
.replace("&", "\\&")
.replace("$", "\\$")
.replace("+", "\\+")
.replace("?", "\\?"))
val = (val
.replace("(", "\(")
.replace(")", "\)")
.replace("&", "\&")
.replace("$", "\$")
.replace("+", "\+")
.replace("?", "\?"))
val = r"(^|\|){}($|\|)" .format(val)
lst.append(val)
reg_institute = r"|".join(lst)
return reg_institute
......
......@@ -312,21 +312,21 @@ class RecordPubli(Record):
Args:
pattern (unicode):
regular expression defining the affiliation keys.
It should not contains groups.
It has to be build for an exact match namely containing
start and end of string. This is reuqired to separate
`Ecole Plolytechnique` from `Ecole Polytechnique, Lausanne`.
Returns:
unicode:
- the affiliation
- the affiliation or the first one when several are found.
- empty string when nothing is found.
"""
# modify the pattern to capture group
pattern = "(%s)" % pattern
data = (self[u"700"].u.str.extract(pattern, expand=False)
.dropna())
df = self[u"700"]
query = df.u.str.contains(pattern)
data = (df[query].u.unique())
return (data.iloc[0] if len(data) > 0 else u"")
return (data[0] if len(data) > 0 else u"")
def find_authors(self, pattern, sep=u", ", sort=False):
"""Find authors containing the regular expression *pattern*.
......@@ -385,7 +385,6 @@ class RecordPubli(Record):
"""
df = self[u"700"]
query = df.u.str.contains(pattern)
if sort:
......
......@@ -73,7 +73,7 @@ class CoreUI(object):
#
# Grid
#
mdf = GridModifier("authors_role")
mdf = GridModifier("authors_roles")
mdf.configure_column("role", width=75)
# ....................................................................
......
......@@ -225,9 +225,9 @@ class ViewportUi(object):
node.add_children(leaves, func=to_grid)
node.add_child(
T("Relation team / projects"),
to_grid("organisation"))
add_child = node.add_child
add_child(T("relation team / projects"), to_grid("organisation"))
add_child(T("authors_roles"), to_grid("authors_roles"))
return node
......
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