Hide primary email relation
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 28 Feb 2017 18:06:00 +0100
changeset 191 fe403024414d
parent 190 b471354d2886
child 192 0d265a69dbc0
Hide primary email relation we don't need it (we could even set cardinality of use_email to '?1')
cubicweb_sherpa/views/__init__.py
--- a/cubicweb_sherpa/views/__init__.py	Tue Feb 28 17:06:12 2017 +0100
+++ b/cubicweb_sherpa/views/__init__.py	Tue Feb 28 18:06:00 2017 +0100
@@ -18,7 +18,7 @@
 from jinja2 import Environment, PackageLoader, select_autoescape
 
 from cubicweb.view import View
-from cubicweb.web.views import urlrewrite, startup
+from cubicweb.web.views import urlrewrite, startup, uicfg
 
 
 _REWRITE_RULES = []
@@ -90,6 +90,9 @@
     del _REWRITE_RULES
 
 
+uicfg.autoform_section.tag_subject_of(('CWUser', 'primary_email', '*'), 'main', 'hidden')
+
+
 def registration_callback(vreg):
     vreg.register_all(globals().values(), __name__, (IndexView,))
     vreg.register_and_replace(IndexView, startup.IndexView)