[views] Deactivate relationwidget's creation form
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 24 Mar 2017 10:18:13 +0100
changeset 2530 7edee761ad4f
parent 2529 46136e5af131
child 2531 02f4b849a80f
[views] Deactivate relationwidget's creation form I don't like it and it doesn't work well. Closes #17066566
cubicweb_seda/views/widgets.py
--- a/cubicweb_seda/views/widgets.py	Wed Mar 22 17:40:32 2017 +0100
+++ b/cubicweb_seda/views/widgets.py	Fri Mar 24 10:18:13 2017 +0100
@@ -24,6 +24,13 @@
 from cubicweb.web import formfields as ff, formwidgets as fw
 from cubicweb.web.views import ajaxcontroller, autoform, formrenderers
 
+from cubes.relationwidget import views as rwdg
+
+
+# deactivate relation widget's creation form by default, it causes some js error if e.g. there are
+# some calendar widgets. Also, we don't really want that from an UX POV, IMO.
+rwdg.SearchForRelatedEntitiesView.has_creation_form = False
+
 
 def configure_relation_widget(req, div, search_url, title, multiple, validate):
     """Build a javascript link to invoke a relation widget