[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/form/browser/add.py Slight refactoring in AddingView.

Gintautas Miliauskas gintas at pov.lt
Tue Feb 1 10:28:10 EST 2005


Log message for revision 29012:
  Slight refactoring in AddingView.
  

Changed:
  U   Zope3/trunk/src/zope/app/form/browser/add.py

-=-
Modified: Zope3/trunk/src/zope/app/form/browser/add.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/add.py	2005-02-01 15:17:17 UTC (rev 29011)
+++ Zope3/trunk/src/zope/app/form/browser/add.py	2005-02-01 15:28:10 UTC (rev 29012)
@@ -88,11 +88,11 @@
                     kw[str(name)] = data[name]
 
         content = self.create(*args, **kw)
-        adapted = self.schema(content)
 
         errors = []
 
         if self._set_before_add:
+            adapted = self.schema(content)
             for name in self._set_before_add:
                 if name in data:
                     field = self.schema[name]
@@ -108,9 +108,8 @@
 
         content = self.add(content)
 
-        adapted = self.schema(content)
-
         if self._set_after_add:
+            adapted = self.schema(content)
             for name in self._set_after_add:
                 if name in data:
                     field = self.schema[name]
@@ -119,7 +118,7 @@
                     except ValidationError:
                         errors.append(sys.exc_info()[1])
 
-            # We've modified the object, so we need to pubish an
+            # We have modified the object, so we need to publish an
             # object-modified event:
             notify(ObjectModifiedEvent(content))
 



More information about the Zope3-Checkins mailing list