Added transaction savepoint after form update to finalize all inner components state before rendering
authorThierry Florac <thierry.florac@onf.fr>
Thu, 14 Jun 2018 10:35:51 +0200
changeset 117 3f6f7f27216f
parent 116 bf60719e676c
child 118 0d462137f10d
Added transaction savepoint after form update to finalize all inner components state before rendering
src/pyams_form/form.py
--- a/src/pyams_form/form.py	Thu Jun 14 08:57:33 2018 +0200
+++ b/src/pyams_form/form.py	Thu Jun 14 10:35:51 2018 +0200
@@ -18,6 +18,7 @@
 import logging
 logger = logging.getLogger('PyAMS (form)')
 
+import transaction
 import venusian
 
 # import interfaces
@@ -133,6 +134,8 @@
         [subform.update() for subform in self.subforms]
         [tabform.update() for tabform in self.tabforms]
         Form.update(self)
+        # savepoint is required for each inner component to be persisted!!
+        transaction.savepoint()
 
     def updateWidgets(self, prefix=None):
         super(BaseForm, self).updateWidgets(prefix)