#1025: Validator decorateor runs when no data is posted in controller
------------------------+---------------------------------------------------
 Reporter:  Kaan        |       Owner:  anonymous
     Type:  defect      |      Status:  new      
 Priority:  normal      |   Milestone:  1.0b1    
Component:  TurboGears  |     Version:  0.9a6    
 Severity:  normal      |    Keywords:           
------------------------+---------------------------------------------------
 Note: there was some disagreement on the irc channel whether or not this
 counts as a bug.

 Here is what the decorators on a controller method look like:

 {{{
 @expose('tgerrs.templates.sat')
 @validate(validators = {'name' : val.String(not_empty=True),
                             'number': val.Number(not_empty=True)})
 @turbogears.error_handler()
 @turbogears.error_handler(welcome, "tg_errors.has_key('number') and
 tg_errors.has_key('name')")
 def index(self, tg_errors=None, **kw):
 ...
 }}}

 If I access this url without sending any data, ie just '/', it goes to the
 welcome page, on account of the not_empty parameters. It looks like the
 validators ran even though there was no data posted.

 I sort of consider this counterintuitive but elvelind on irc disagreed, so
 I guess we'll have to decide if this is a bug or not.

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1025>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to