diff options
| author | Mads Jensen <mje@inducks.org> | 2017-09-30 18:13:30 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-09-30 18:01:35 -0400 |
| commit | 77d1b196235edd54ca49bc6ee4783d860410e3d8 (patch) | |
| tree | ca3eca4eafc6b253aa90e73abc7f35adeb2e7b2e | |
| parent | fd866c25d1665b73aff0d8312c414ae6f69812a3 (diff) | |
Removed always True if check in stringfilter decorator.
| -rw-r--r-- | django/template/defaultfilters.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index b172be6239..298347429f 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -37,12 +37,11 @@ def stringfilter(func): passed as the first positional argument will be converted to a string. """ def _dec(*args, **kwargs): - if args: - args = list(args) - args[0] = str(args[0]) - if (isinstance(args[0], SafeData) and - getattr(_dec._decorated_function, 'is_safe', False)): - return mark_safe(func(*args, **kwargs)) + args = list(args) + args[0] = str(args[0]) + if (isinstance(args[0], SafeData) and + getattr(_dec._decorated_function, 'is_safe', False)): + return mark_safe(func(*args, **kwargs)) return func(*args, **kwargs) # Include a reference to the real function (used to check original |
