diff options
| author | Batuhan Taşkaya <btaskaya33@gmail.com> | 2019-05-07 05:02:08 +0300 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-05-17 09:53:24 +0200 |
| commit | 5c19274643dacc0a16e26634aa5dc34bd11a7077 (patch) | |
| tree | 92cf612458e9e85781c07d2973b0bf131c5a9f12 /django | |
| parent | 8d010f39869f107820421631111417298d1c5bb9 (diff) | |
Fixed #30453 -- Fixed crash of simple_tag() and inclusion_tag() when function is wrapped.
getfullargspec() doesn't work with wrapped functions.
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/library.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/template/library.py b/django/template/library.py index f88c2af822..20bc86dac8 100644 --- a/django/template/library.py +++ b/django/template/library.py @@ -1,6 +1,6 @@ import functools from importlib import import_module -from inspect import getfullargspec +from inspect import getfullargspec, unwrap from django.utils.html import conditional_escape from django.utils.itercompat import is_iterable @@ -106,7 +106,7 @@ class Library: return 'world' """ def dec(func): - params, varargs, varkw, defaults, kwonly, kwonly_defaults, _ = getfullargspec(func) + params, varargs, varkw, defaults, kwonly, kwonly_defaults, _ = getfullargspec(unwrap(func)) function_name = (name or getattr(func, '_decorated_function', func).__name__) @functools.wraps(func) @@ -143,7 +143,7 @@ class Library: return {'choices': choices} """ def dec(func): - params, varargs, varkw, defaults, kwonly, kwonly_defaults, _ = getfullargspec(func) + params, varargs, varkw, defaults, kwonly, kwonly_defaults, _ = getfullargspec(unwrap(func)) function_name = (name or getattr(func, '_decorated_function', func).__name__) @functools.wraps(func) |
