[web2py] Re: can auth.settings.on_failed_authorizatio raise http 403 error

2011-10-19 Thread Anthony
You should do: auth.settings.on_failed_authorization = fff You were calling the function fff() instead of assigning it to on_failed_authorization. Auth will call the function itself at the appropriate time. Anthony On Wednesday, October 19, 2011 10:21:18 AM UTC-4, d wrote: Hi All, I am

[web2py] Re: can auth.settings.on_failed_authorizatio raise http 403 error

2011-10-19 Thread d
Thanks Anthony, After change to auth.settings.on_failed_authorization = fff for controller which requires log in and if user not logged in, it redirect to log in page. But purpose of using fff function is to raise http error but not redirecting to log in page. def fff(): raise HTTP(403,

Re: [web2py] Re: can auth.settings.on_failed_authorizatio raise http 403 error

2011-10-19 Thread Bruno Rocha
On Wed, Oct 19, 2011 at 1:31 PM, d sund...@gmail.com wrote: so, any idea where is problem? is it because fff() function is not right? Any @auth. decorators first check if the user is logged in. So it is checking for logged in user before fire your fff function. You can supress (only in

[web2py] Re: can auth.settings.on_failed_authorizatio raise http 403 error

2011-10-19 Thread d
Thanks a lot for reply. It is the problem. And there is minor change in fff function needed def fff(args): raise HTTP(403, HTTP 403: Not authenticated to access this URL.) because if do not put args in fff(), it complains error Now it works fine. Thanks a lot! This forum is really useful