[web2py] Re: logout error

2015-03-02 Thread Alex Glaros
Is this wrong also for decorating functions? Should only have the admin membership decorator? @auth.requires_login() @auth.requires_membership("admin") thanks Alex Glaros On Friday, February 14, 2014 at 8:03:28 PM UTC-8, Massimo Di Pierro wrote: > > You should NOT have both: > > @auth.requir

[web2py] Re: logout error

2014-02-17 Thread ajith c t
Thanks for the help , I will look into it. Anything that helps improve my code is always welcome. On Monday, 17 February 2014 22:26:42 UTC+5:30, Anthony wrote: > > I wrapped the code in try/ except so that I could log everything and save >> it in a file, and in case of an error redirect to ano

[web2py] Re: logout error

2014-02-17 Thread Anthony
> > I wrapped the code in try/ except so that I could log everything and save > it in a file, and in case of an error redirect to another page. If there is > a better workaround please let me know. > See http://web2py.com/books/default/chapter/29/04/the-core#Routes-on-error for more sophistica

[web2py] Re: logout error

2014-02-17 Thread ajith c t
I too raised the HTTP class and its working fine now, thank you to all for your continued support. I wrapped the code in try/ except so that I could log everything and save it in a file, and in case of an error redirect to another page. If there is a better workaround please let me know. On M

[web2py] Re: logout error

2014-02-17 Thread Anthony
To avoid catching the HTTP exceptions, you can do something like this: except Exception as e: if isinstance(e, HTTP): raise e Anyway, why are you wrapping all of you code in try/except statements -- web2py already catches all exceptions? Anthony On Monday, February 17, 2014

[web2py] Re: logout error

2014-02-17 Thread ajith c t
Thank you LightDot, saved my day and work at the right time. Read in forums that redirect() is internally calling a 303 exception, but didn't realise that I was catching that too and redirecting to errorpage. Thanks for the support. On Monday, 17 February 2014 17:02:41 UTC+5:30, LightDot wrote:

[web2py] Re: logout error

2014-02-17 Thread LightDot
Keep in mind that redirect() is an equivalent to raising an HTTP(303) exception. In other words, an intentional exception is raised to create a redirect. Looks like it's your own code doing a traceback and creating an error page on every exception, including the cases of the intentional redire

[web2py] Re: logout error

2014-02-16 Thread ajith c t
Hi Massimo, there is one more thing, it seems that the redirect problem is not only with my login function. Every function where I use a redirect call from my controller results in a error page with a log as 303 error. File "/srv/trustvouch-fe/applications/app/controllers/default.py", line 480,

[web2py] Re: logout error

2014-02-16 Thread ajith c t
Sorry Massimo, I commented both the requires_login() and requires_permission() for both dashboard() and my index() functions, still the error is same. 2014-02-17 06:12:42,411 - ERROR - app - Traceback (most recent call last): File "/srv/trustvouch-fe/applications/app/controllers/default.py",

[web2py] Re: logout error

2014-02-16 Thread Massimo Di Pierro
Sorry I mean here: @auth.requires_login() @auth.requires_permission(request.function) def dashboard(): you should NOT have both. Perhaps this was causing the problem? On Saturday, 15 February 2014 09:15:18 UTC-6, ajith c t wrote: > > Hi Massimo, > > Thanks for the reply, but sorry to s

[web2py] Re: logout error

2014-02-15 Thread ajith c t
Hi Massimo, Thanks for the reply, but sorry to say this, but I didn't understand what you meant there, which function should have both. I wanted every user to have login and logout functions, thats why I didn't add auth.permission for them. And can you explain why it is giving 303 er

[web2py] Re: logout error

2014-02-14 Thread Massimo Di Pierro
You should have both: @auth.requires_login() @auth.requires_permission(request.function) the latter implies the former On Friday, 14 February 2014 04:27:31 UTC-6, ajith c t wrote: > > Hi I updated web2py 2.5 to 2.8, > > now the login and logout seems to work but with a problem, > > the login pa

[web2py] Re: logout error

2014-02-14 Thread ajith c t
Hi I updated web2py 2.5 to 2.8, now the login and logout seems to work but with a problem, the login page redirects to errorpage and logout correctly redirects to login page. But my logs are: *** 2014-02-14 10:18:45,224 - DEBUG -