Guest User

Untitled

a guest
May 5th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def anonynous_required(test_func=None):
  2. def decorator(view_func):
  3. def _wrapped_view(request, *args, **kwargs):
  4. if request.user.is_authenticated():
  5. return HttpResponseRedirect("/home")
  6. return view_func(request, *args, **kwargs)
  7. return wraps(view_func)(_wrapped_view)
  8. return decorator
  9.  
  10.  
  11.  
  12.  
  13. ======================================================================
  14. ERROR :
  15.  
  16. AttributeError at /
  17. 'WSGIRequest' object has no attribute '__name__'
Advertisement
Add Comment
Please, Sign In to add comment