To clarify, when I'm doing form validation inside of the controller action in conjunction with an @authenticate_form decorator:
1.) Everything is fine when submitting a valid form. 2.) When a form is submitted, validation fails, the problems are corrected and the form resubmitted, then it detects a cross site forgery and 403s because input[type=hidden]#_authentication_token is not populated with a value. On Aug 22, 9:04 pm, Ryan <[email protected]> wrote: > Alright, new problem: It doesn't work in conjunction with form > validation. I believe I read somewhere that if you're using decorators > to validate along with the @authenticate_form, then the order matters. > In my case, I'm only using the @authenticate_form decorator and I'm > validating inside of the controller action because the decorator > wasn't flexible enough to give me the state information I needed: > > # Taken > fromhttp://wiki.pylonshq.com/display/pylonscookbook/Validation+without+th... > form = UserUpdateValidation() > if not > form.is_valid(state=State(current_user=self.current_user)): > return form.complain(self.edit()) > > Any thoughts on how to either 1.) get the @authenticate_form decorator > to play nice, or 2.) how to use it without the decorator? > > Thanks. > > On Aug 22, 8:59 pm, Ryan McKillen <[email protected]> wrote: > > > > > Facepalm. Thanks!! > > > On Sun, Aug 22, 2010 at 8:33 PM, cd34 <[email protected]> wrote: > > > The import should be in lib/helpers.py rather than your controller so > > > that it is exposed in your templates. > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "pylons-discuss" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<pylons-discuss%2bunsubscr...@go > > > oglegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/pylons-discuss?hl=en. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
