On Jul 9, 2011, at 10:46 AM, Jim Karsten wrote:
> When controller2 is called it redirects to controller1. The session.flash
> message is lost. Any suggestions for how to prevent the response.flash from
> clobbering the session.flash?
>
> def controller1():
> form = SQLFORM.factory(Field('myfield'))
>
> if form.accepts(request.vars,session):
>
> response.flash = 'Record updated'
>
> elif form.errors:
>
> response.flash = 'Form contains errors'
>
> else:
>
> response.flash = 'Please fill in the form'
>
> return dict(form=form)
>
>
>
> def controller2():
>
> session.flash = 'Message from session flash.'
>
> redirect(URL('controller1'))
Try removing the else: clause in controller1.