Moved invariants verification to ZMI
authorThierry Florac <thierry.florac@onf.fr>
Thu, 03 May 2018 11:35:53 +0200
changeset 85 ae47f20eae33
parent 84 2be886bff11b
child 86 48af829c3e59
Moved invariants verification to ZMI
src/pyams_portal/interfaces/__init__.py
--- a/src/pyams_portal/interfaces/__init__.py	Fri Apr 27 17:49:28 2018 +0200
+++ b/src/pyams_portal/interfaces/__init__.py	Thu May 03 11:35:53 2018 +0200
@@ -397,17 +397,17 @@
                           required=True,
                           default=True)
 
+    override_parent = Bool(title=_("Override parent template?"),
+                           description=_("Should we override parent template?"),
+                           required=True,
+                           default=False)
+
     use_local_template = Bool(title=_("Use local template?"),
                               description=_("If 'yes', you can define a custom local template instead of "
                                             "a shared template"),
                               required=True,
                               default=False)
 
-    @invariant
-    def check_template(self):
-        if not (self.use_local_template or self.shared_template):
-            raise Invalid(_("You must choose to use a local template or select a shared one!"))
-
     local_template = Object(title=_("Local template"),
                             schema=IPortalTemplate,
                             required=False,