Commit 1594274b authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

Handle case where we can't find a suitable vocabulary on a component archive unit

In such case, there are no 'seda_*' relations in the rql since we're not in the
context of an archive transfer which hold them.
parent c45e96cc17c1
......@@ -7717,6 +7717,11 @@ msgctxt "SEDATemporal"
msgid "temporal"
msgstr ""
msgid ""
"there is no scheme available for this relation. Contact the site "
"administrator."
msgstr ""
msgid "this concept doesn't belong to scheme specified on the profile"
msgstr ""
......
......@@ -7739,6 +7739,13 @@ msgctxt "SEDATemporal"
msgid "temporal"
msgstr ""
msgid ""
"there is no scheme available for this relation. Contact the site "
"administrator."
msgstr ""
"Il n'y a pas de vocabulaire disponible pour cette relation. Veuillez "
"contacter l'administrateur du site."
msgid "this concept doesn't belong to scheme specified on the profile"
msgstr "ce concept n'appartient pas au vocabulaire spécifier sur le profil"
......
......@@ -63,6 +63,10 @@ class ContainedRelationFacetWidget(rwdg.RelationFacetWidget):
rql_expr = scheme_rql_expr(container, form.edited_entity.cw_etype, field.name)
if not req.execute('Any CS WHERE ' + rql_expr, {'container': container.eid}):
scheme_relations = [x for x in rql_expr.split() if x.startswith('seda_')]
if not scheme_relations:
w(req._('there is no scheme available for this relation. '
'Contact the site administrator.'))
return
if len(scheme_relations) == 1:
scheme_relation = req._(scheme_relations[0])
else:
......
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