summaryrefslogtreecommitdiff
path: root/django/utils/decorators.py
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2008-02-28 21:24:51 +0000
committerJustin Bronn <jbronn@gmail.com>2008-02-28 21:24:51 +0000
commit22e016ff6c18a35a450519b94de63033f83e6b4f (patch)
tree1e58cc40a636b4e4f3dcf429a5a116c015c36278 /django/utils/decorators.py
parent0b52413cc926446f238fd781b4def6804f64d231 (diff)
gis: Merged revisions 7105-7168 via svnmerge from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7176 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/decorators.py')
-rw-r--r--django/utils/decorators.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/utils/decorators.py b/django/utils/decorators.py
index 57ce29fca4..27a080e740 100644
--- a/django/utils/decorators.py
+++ b/django/utils/decorators.py
@@ -1,6 +1,10 @@
"Functions that help with dynamically creating decorators for views."
import types
+try:
+ from functools import wraps
+except ImportError:
+ from django.utils.functional import wraps # Python 2.3, 2.4 fallback.
def decorator_from_middleware(middleware_class):
"""
@@ -53,5 +57,5 @@ def decorator_from_middleware(middleware_class):
if result is not None:
return result
return response
- return _wrapped_view
+ return wraps(view_func)(_wrapped_view)
return _decorator_from_middleware