src/pyams_content/component/illustration/zmi/__init__.py
changeset 489 dcdb0ce828f8
parent 395 2a39b333a585
child 527 5dd1aa8bedd9
--- a/src/pyams_content/component/illustration/zmi/__init__.py	Tue Mar 20 13:50:46 2018 +0100
+++ b/src/pyams_content/component/illustration/zmi/__init__.py	Tue Mar 20 13:51:32 2018 +0100
@@ -100,10 +100,11 @@
 
     def get_ajax_output(self, changes):
         output = super(IllustrationPropertiesInnerEditForm, self).get_ajax_output(changes)
-        illustration_changes = changes.get(IIllustration, ())
-        if ('data' in illustration_changes) or ('renderer' in illustration_changes):
-            # we have to commit transaction to be able to handle blobs...
-            ITransactionManager(self.context).get().commit()
+        updated = changes.get(IIllustration, ())
+        if ('data' in updated) or ('renderer' in updated):
+            if 'data' in updated:
+                # we have to commit transaction to be able to handle blobs...
+                ITransactionManager(self.context).get().commit()
             form = IllustrationPropertiesInnerEditForm(self.context, self.request)
             form.update()
             illustration = form.getContent()