[PATCH 1 of 1 sherpa] Hide primary email relation

Sylvain Thenault sylvain.thenault at logilab.fr
Wed Mar 1 12:34:50 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1488301560 -3600
#      Tue Feb 28 18:06:00 2017 +0100
# Node ID fe403024414d061ef6d8ac6d1ef27718fb7ef363
# Parent  b471354d2886099ec5d73befc04e0ee3d85c0de3
Hide primary email relation

we don't need it (we could even set cardinality of use_email to '?1')

diff --git a/cubicweb_sherpa/views/__init__.py b/cubicweb_sherpa/views/__init__.py
--- a/cubicweb_sherpa/views/__init__.py
+++ b/cubicweb_sherpa/views/__init__.py
@@ -16,11 +16,11 @@
 # with this program. If not, see <http://www.gnu.org/licenses/>.
 
 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 = []
 _JINJA_ENV = Environment(loader=PackageLoader('cubicweb_sherpa.views'),
                          autoescape=select_autoescape(enabled_extensions=('html',)))
@@ -88,10 +88,13 @@ class SherpaReqRewriter(urlrewrite.Simpl
     global _REWRITE_RULES
     rules = tuple(_REWRITE_RULES)
     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)
 
     from cubicweb.web.views import actions, bookmark, cwuser


More information about the saem-devel mailing list