[forms] make it easier to override CWProperty form buttons stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Fri, 08 Jan 2010 12:17:42 +0100
branchstable
changeset 4216 6c9e67a89b3a
parent 4215 9fbc39453012
child 4217 bf2811a17a17
[forms] make it easier to override CWProperty form buttons
web/views/cwproperties.py
--- a/web/views/cwproperties.py	Fri Jan 08 12:14:29 2010 +0100
+++ b/web/views/cwproperties.py	Fri Jan 08 12:17:42 2010 +0100
@@ -67,6 +67,7 @@
     """site-wide properties edition form"""
     id = 'systempropertiesform'
     __select__ = none_rset() & match_user_groups('managers')
+    form_buttons = [SubmitButton()]
 
     title = _('site configuration')
     category = 'startupview'
@@ -187,10 +188,9 @@
         return entity
 
     def form(self, formid, keys, splitlabel=False):
-        buttons = [SubmitButton()]
         form = self.vreg['forms'].select(
             'composite', self.req, domid=formid, action=self.build_url(),
-            form_buttons=buttons,
+            form_buttons=self.form_buttons,
             onsubmit="return validatePrefsForm('%s')" % formid,
             submitmsg=self.req._('changes applied'))
         path = self.req.relative_path()