Commit fc840755 authored by Noé Gaumont's avatar Noé Gaumont 🐙
Browse files

fix: try to import cube relationwidget with new and old cube format

parent 4138933b4bd6
......@@ -17,12 +17,22 @@
from cubicweb import tags
from cubicweb.predicates import is_instance
relationwidget_imported = False
try:
from cubes.relationwidget import views as rwdg
from cubicweb_relationwidget import views as rwdg
relationwidget_imported = True
except ImportError:
pass
else:
if not relationwidget_imported:
# try to import old_style cube format if it failed with new_format
try:
from cubes.relationwidget import views as rwdg # noqa
relationwidget_imported = True
except ImportError:
pass
if relationwidget_imported:
class SearchForRelatedConceptsView(rwdg.SearchForRelatedEntitiesView):
"""Specializes relation widget to link to concepts which are expected to be constrained by
an RQL expression on the edited relation definition.
......
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