Permalink
Browse files

Removed always True if check in stringfilter decorator.

  • Loading branch information...
atombrella authored and timgraham committed Sep 30, 2017
1 parent fd866c2 commit 77d1b196235edd54ca49bc6ee4783d860410e3d8
Showing with 5 additions and 6 deletions.
  1. +5 −6 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

0 comments on commit 77d1b19

Please sign in to comment.