On Monday, May 8, 2017 at 5:08:59 AM UTC-4, Yebach wrote: > > Flash is show on my index page so the position <div > class="flash">{{=session.flash > or ''}}</div> is ok > I just put session.flash('Some random text') in my index function and it > works >
session.flash is not intended to work that way. You use session.flash only when you are doing a redirect, in which case, it gets moved from session.flash to response.flash after the redirect. So, the template should have {{=response.flash}}, not {{=session.flash}}. > My code for user registration in index.py user > > if request.args(0) == 'register': > > #form = auth.register() > if form.process().accepted: > > #some code > > session.flash = ('Thank you for registering. Please check your e-mail > account') > > redirect(URL(request.application, 'default', 'index')) > > How is "form" defined above? If it is defined as form=auth.register(), then you cannot subsequently call form.process(), as auth.register() already calls form.process(). Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.