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__
wrap.__name__=f.__name__
return wrap
But the request object that I get is class object of the view and not the regular request object
e.g if I do print (request) output is
<login.views.Test object at 0x7ff106d82a50>
where am I going wrong.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/29032820-92e3-4486-9388-dc06b7d414b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment