Hey chris.

Thanks for this.   It fixed the common case where a validate decorator
gets an error_handler, but breaks the case where the method itself is
used as the default error_handler (since that method is already
bound...).

I've checked in a fix that works in both cases, along with tests for
both cases.   Hopefully we're getting to the point that validation is
reasonably well tested.   ;)

We still need to do a non-toscawidgets formencode schema validation
test or two though before I'll feel comfortable with the level of
testing we've got on validation.

--Mark Ramm


---------- Forwarded message ----------
From:  <[EMAIL PROTECTED]>
Date: Sat, Apr 5, 2008 at 6:38 PM
Subject: [turbogears-commits] r4341 - trunk/tg
To: [EMAIL PROTECTED]



 Author: percious
 Date: Sat Apr  5 17:38:37 2008
 New Revision: 4341
 URL: http://trac.turbogears.org/changeset/4341

 Log:
 fixes to validation.  error_hanlder call did not have a controller passed in.

 Modified:
   trunk/tg/controllers.py

 Modified: trunk/tg/controllers.py
 ==============================================================================
 --- trunk/tg/controllers.py     (original)
 +++ trunk/tg/controllers.py     Sat Apr  5 17:38:37 2008
 @@ -37,7 +37,7 @@
         #Initialize new_params -- if it never gets updated just return params
         new_params = None
         errors = {}
 -
 +
         #TG developers can pass in a dict of param names and validators
         #this applies them one by one and builds up a new set of
validated params.
         if isinstance(validation.validators, dict):
 @@ -155,7 +155,7 @@
         if error_handler is None:
             error_handler = controller

 -        output = error_handler(**dict(params))
 +        output = error_handler(controller, **dict(params))

         return error_handler, output




-- 
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to