I am also experiencing this issue, however I tried to recreate it with a 
simple view/controller, and was unable to do so, but I have a much larger 
application with the problem. I'm currently using v 2.2.1.

Is there any way to "watch" the session.flash variable to see where it is 
getting unset after doing the redirect?

On Friday, December 28, 2012 10:41:52 PM UTC-6, Massimo Di Pierro wrote:
>
> I am now are of this problem. Can you please post a complete minimalist 
> code example (model, controller, view) so we can try reproduce it? What 
> web2py version are you using?
>
> On Friday, 28 December 2012 20:18:17 UTC-6, VP wrote:
>>
>> I do not think it s a js issue, because there's no js error and after 
>> removing the js (my own, not web2py's), the problem is still there.
>>
>> Say I have a controller f
>>
>> def f():
>>   form = ....
>>   if form.processes(onvalidation=...).accepted:
>>       session.flash = 'Test'
>>       redirect(URL('f', args=form.vars.id))
>>
>>
>> Session.flash does not work for this particular controller.  For other 
>> controller, it seems fine.
>>
>> This also is related to what I think another web2py bug.  The reason I 
>> had to redirect to the same controller after form submission, is because 
>> the model has some fields of type list:integer.  The problem is that when 
>> you have a list of integers with duplicates values, web2py (probably form), 
>> does not process that properly;
>>
>> ===> Web2py essentially messes up everything when you have a 
>> list:integers with same values **and** you do not redirect.
>>
>> This is why I had to redirect, but when I redirect to the same update 
>> page, session flash does not seem to work (for this particular controller).
>>
>>
>>
>>
>>
>>
>>
>>
>> On Thursday, December 27, 2012 11:39:31 PM UTC-6, Massimo Di Pierro wrote:
>>>
>>> Please post an example to reproduce the problem. Could it be a js issue? 
>>> Do you get chrome errors? Is the flash in the page text?
>>>
>>> On Thursday, 27 December 2012 17:55:46 UTC-6, VP wrote:
>>>>
>>>> session.flash does not work properly for me either (latest web2py 
>>>> stable version).
>>>>
>>>> when i redirect to the same controller , it works for some controller 
>>>> and doesn't work for other controllers.
>>>>
>>>> Have no idea why.
>>>>
>>>

-- 



Reply via email to