Can you post an example of how you are using the decorator? If you are
using it on a dispatch/get/post ... method of a class based views, it will
still get the instance (self) as a first parameter. So you should take also
self as an argument to your inner wrap method.
Unrelated: Your wrap metho
On Thursday, 2 November 2017 09:53:33 UTC+5:30, rohit.a...@gmail.com wrote:
>
> def authenticated(f):
> def wrap(request, *args, **kwargs):
> token = request.META.get('HTTP_AUTHORIZATION')
> entry = Person.objects.get(pk=kwargs['entry_id'])
> payload = jwt.decode(token, SECRET)
> user = Person.ob
def authenticated(f):
def wrap(request, *args, **kwargs):
token = request.META.get('HTTP_AUTHORIZATION')
entry = Person.objects.get(pk=kwargs['entry_id'])
payload = jwt.decode(token, SECRET)
user = Person.objects.get(
username=payload.get('username'),
pk=payload.get('id'))
wrap.__doc__=f.__doc__
w
3 matches
Mail list logo