Maybe I'm missing something... Now I tryed a simple one and it don't
ask me for authenticantion.
btw, I'm using rev457.
"""
import turbogears
from turbogears import controllers
from turbogears import identity
import cherrypy
class Root(controllers.RootController):
@turbogears.expose( html="wgstock.templates.main" )
@identity.require( identity.in_group( "registados" ) )
def index( self ):
return dict()
@turbogears.expose( html="wgstock.templates.login" )
def login( self, *args, **kw ):
if hasattr(cherrypy.request,"identity_errors"):
msg= str(cherrypy.request.identity_errors)
else:
msg= "Please log in"
cherrypy.response.status=403
#return dict( message=msg,
previous_url=cherrypy.request.path )
#to preserve the session you may want to return this
instead:
return dict( message = msg, previous_url = turbogears.url(
cherrypy.request.path, cherrypy.request.paramMap ) )
"""