I'm trying to make an authentication: i've just made new application,
the auth settings in db model are default (I'm using web2py 1.64.1),
and I defined in my default controller two functions:
@auth.requires_login()
def secret():
return 'secret one..'
def nosecret():
return 'not secret'
I have also defined menu:
main_menu=[
['Tajne',False,URL(r=request,f='secret')],
['Nietajne',False,URL(r=request,f='nosecret')]
#['<- Back',False,URL(r=request, f='index')]
]
response.menu=main_menu
While I'm logged in, and try to call secret(), everything goes well.
But if I'm not authenticated, then the login form is shown - I'm
logging in (correct credentials),
but the function secret() isn't called, and I get the following error:
Traceback (most recent call last):
File "/Users/msh/c_workspace/AI_projekt/web2py/gluon/restricted.py",
line 107, in restricted
exec ccode in environment
File "/Users/msh/c_workspace/AI_projekt/web2py/applications/sklep/
controllers/default.py", line 62, in <module>
File "/Users/msh/c_workspace/AI_projekt/web2py/gluon/globals.py",
line 100, in <lambda>
self._caller = lambda f: f()
File "/Users/msh/c_workspace/AI_projekt/web2py/applications/sklep/
controllers/default.py", line 42, in user
return dict(form=auth())
File "/Users/msh/c_workspace/AI_projekt/web2py/gluon/tools.py", line
437, in __call__
return self.login()
File "/Users/msh/c_workspace/AI_projekt/web2py/gluon/tools.py", line
729, in login
next = self.url(next.replace('[id]', str(form.vars.id)))
AttributeError: 'list' object has no attribute 'replace'
What I'm doing wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---