#812: validators.to_python(kw) in controllers.py broken
----------------------+-----------------------------------------------------
Reporter: Smirnov | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 0.9
Component: CherryPy | Version:
Severity: major | Keywords: validators formencode
----------------------+-----------------------------------------------------
Looking at http://trac.turbogears.org/turbogears/changeset/1106, it seems
like someone was aware that something was broken with the validation.
However, upon inspecting it further....
(controllers.py)
{{{
117 try:
118 value = kw.copy()
119 kw.update(validators.to_python(value))
}}}
Why are we trying to validate kw? kw is list of all arguments that the
method expects -- it means you end up trying to validate things like self
and tg_errors, or any other parameters that are listed in the method but
don't necessarily exist after you hit "Submit" on a form.
Shouldn't line 119 be instead
{{{
kw.update(validators.to_python(cherrypy.request.params))
}}}
This isn't even hypothetical, I had trouble with formencode giving me
errors, then I printed kw and I saw it was trying to validate a lot of
other crap.
'''FORM ERRORS: The input field 'tg_errors' was not expected. <type
'str'>'''
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/812>
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
-~----------~----~----~----~------~----~------~--~---