summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-01-21 13:20:17 -0500
committerGitHub <noreply@github.com>2017-01-21 13:20:17 -0500
commit9e6e32bf5dce69f3257fcbe4ce80839fb65ab3df (patch)
tree32df7e798d6cd84ca62a1ff8db1355cc06bd2d71 /django/utils
parent8249c5b38237172152835784bda2b55c2c7a672e (diff)
Refs #23919 -- Removed django.utils.decorators.available_attrs() usage.
It's only needed to workaround a bug on Python 2.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/decorators.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/utils/decorators.py b/django/utils/decorators.py
index a3af946b33..7621d2fabd 100644
--- a/django/utils/decorators.py
+++ b/django/utils/decorators.py
@@ -79,7 +79,7 @@ def method_decorator(decorator, name=''):
# Don't worry about making _dec look similar to a list/tuple as it's rather
# meaningless.
if not hasattr(decorator, '__iter__'):
- update_wrapper(_dec, decorator, assigned=available_attrs(decorator))
+ update_wrapper(_dec, decorator)
# Change the name to aid debugging.
if hasattr(decorator, '__name__'):
_dec.__name__ = 'method_decorator(%s)' % decorator.__name__
@@ -113,6 +113,7 @@ def decorator_from_middleware(middleware_class):
return make_middleware_decorator(middleware_class)()
+# Unused, for backwards compatibility in Django 2.0.
def available_attrs(fn):
"""
Return the list of functools-wrappable attributes on a callable.
@@ -127,7 +128,7 @@ def make_middleware_decorator(middleware_class):
middleware = middleware_class(*m_args, **m_kwargs)
def _decorator(view_func):
- @wraps(view_func, assigned=available_attrs(view_func))
+ @wraps(view_func)
def _wrapped_view(request, *args, **kwargs):
if hasattr(middleware, 'process_request'):
result = middleware.process_request(request)