Author: adrian
Date: 2006-07-27 12:41:28 -0500 (Thu, 27 Jul 2006)
New Revision: 3461
Modified:
django/trunk/django/contrib/auth/decorators.py
Log:
Fixed #2388 -- login_required decorator now preserves docstring and name of
decorated function. Thanks, [EMAIL PROTECTED]
Modified: django/trunk/django/contrib/auth/decorators.py
===================================================================
--- django/trunk/django/contrib/auth/decorators.py 2006-07-27 17:03:35 UTC
(rev 3460)
+++ django/trunk/django/contrib/auth/decorators.py 2006-07-27 17:41:28 UTC
(rev 3461)
@@ -13,6 +13,9 @@
if test_func(request.user):
return view_func(request, *args, **kwargs)
return HttpResponseRedirect('%s?%s=%s' % (login_url,
REDIRECT_FIELD_NAME, quote(request.get_full_path())))
+ _checklogin.__doc__ = view_func.__doc__
+ _checklogin.__dict__ = view_func.__dict__
+ _checklogin.__name__ = view_func.__name__
return _checklogin
return _dec
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---