Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def anonynous_required(test_func=None):
- def decorator(view_func):
- def _wrapped_view(request, *args, **kwargs):
- if request.user.is_authenticated():
- return HttpResponseRedirect("/home")
- return view_func(request, *args, **kwargs)
- return wraps(view_func)(_wrapped_view)
- return decorator
- ======================================================================
- ERROR :
- AttributeError at /
- 'WSGIRequest' object has no attribute '__name__'
Advertisement
Add Comment
Please, Sign In to add comment