SVN: r24940 - trunk/quixote/form2

David Binger <dbinger-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]> Thu, 19 Aug 2004 12:12:44 -0400
Newsgroups gmane.comp.web.quixote.cvs
Message-ID <[email protected]>
Author: dbinger
Date: 2004-08-17 18:40:47 -0400 (Tue, 17 Aug 2004)
New Revision: 24940

Modified:
   trunk/quixote/form2/form.py
   trunk/quixote/form2/widget.py
Log:
Don't parse empty POSTS. (from Neil) 


Modified: trunk/quixote/form2/form.py
===================================================================
--- trunk/quixote/form2/form.py	2004-08-17 21:52:12 UTC (rev 24939)
+++ trunk/quixote/form2/form.py	2004-08-17 22:40:47 UTC (rev 24940)
@@ -189,7 +189,7 @@
         """
         request = get_request()
         has_errors = False
-        if request.form:
+        if self.is_submitted():
             for widget in self.get_all_widgets():
                 if widget.has_error(request=request):
                     has_errors =  True

Modified: trunk/quixote/form2/widget.py
===================================================================
--- trunk/quixote/form2/widget.py	2004-08-17 21:52:12 UTC (rev 24939)
+++ trunk/quixote/form2/widget.py	2004-08-17 22:40:47 UTC (rev 24940)
@@ -125,7 +125,7 @@
             self._parsed = True
             if request is None:
                 request = get_request()
-            if request.form:
+            if request.form or request.get_method() == 'POST':
                 try:
                     self._parse(request)
                 except WidgetValueError, exc: