[web2py] Re: How to prevent interactive shell from 303 error with redirect in model file.

2014-07-27 Thread Mark Li
Thanks a lot, Anthony! I was not aware of request.global_settings.cmd_options, and yes it works in differentiating between the http request and shell. I've posted up a ticket for this as well: https://code.google.com/p/web2py/issues/detail?id=1957 On Saturday, July 26, 2014 8:27:48 PM UTC-7,

[web2py] Re: How to prevent interactive shell from 303 error with redirect in model file.

2014-07-26 Thread Anthony
Try: cmd_opts = request.global_settings.cmd_options if request.function=="index" and not (cmd_opts and (cmd_opts.shell or cmd_opts.scheduler)): redirect(URL('splash')) We should probably provide a more convenient method to check whether we have an http request vs. a shell or scheduler run (