The problem is that add_team is not an action. The other problem is
the order of decorators.
In this case
@auth.requires_login()
@service.jsonrpc
def add_team(name, cap):
#function uses auth.user.id
You register the service (jsonrpc) before requiring_login therefore
login would not be used.
Massimo,
Could you please elaborate a bit further? Is this restriction
something peculiar to auth.requires_login? or service.jsonrpc? or
both? Or is it something that applies to any use of multiple
decorators in web2py?
Thanks,
Mike
On May 7, 10:32 am, mdipierro wrote:
> You cannot do this:
>
Excellent... thanks
On 7 May 2010, at 15:32, mdipierro wrote:
> You cannot do this:
>
> @auth.requires_login()
> @service.jsonrpc
> def add_team(name, cap):
>#function uses auth.user.id
>
> but you can do
>
> @service.jsonrpc
> def add_team(name, cap):
>#function uses auth.user.id
>
> @a
You cannot do this:
@auth.requires_login()
@service.jsonrpc
def add_team(name, cap):
#function uses auth.user.id
but you can do
@service.jsonrpc
def add_team(name, cap):
#function uses auth.user.id
@auth.requires_login()
def call(): return service()
On May 7, 9:17 am, Carl wrote:
>
4 matches
Mail list logo