summaryrefslogtreecommitdiff
path: root/django/utils/decorators.py
diff options
context:
space:
mode:
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