Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2208 -- Allow empty arguments to be passed to filters. Thanks,…

… mattmcc.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3852 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9c0568e21ef8acde73e43cd899cf2a74967489b2 1 parent a27f12f
Malcolm Tredinnick authored September 26, 2006
2  AUTHORS
@@ -104,7 +104,9 @@ answer newbie questions, and generally made Django that much better:
104 104
     Eugene Lazutkin <http://lazutkin.com/blog/>
105 105
     Jeong-Min Lee
106 106
     Christopher Lenz <http://www.cmlenz.net/>
  107
+    lerouxb@gmail.com
107 108
     limodou
  109
+    mattmcc
108 110
     Martin Maney <http://www.chipy.org/Martin_Maney>
109 111
     Manuzhai
110 112
     Petar Marić
2  django/template/__init__.py
@@ -532,7 +532,7 @@ def __init__(self, token, parser):
532 532
                 constant_arg, i18n_arg, var_arg = match.group("constant_arg", "i18n_arg", "var_arg")
533 533
                 if i18n_arg:
534 534
                     args.append((False, _(i18n_arg.replace(r'\"', '"'))))
535  
-                elif constant_arg:
  535
+                elif constant_arg is not None:
536 536
                     args.append((False, constant_arg.replace(r'\"', '"')))
537 537
                 elif var_arg:
538 538
                     args.append((True, var_arg))
3  tests/regressiontests/templates/tests.py
@@ -170,6 +170,9 @@ def test_templates(self):
170 170
             # Escaped backslash using known escape char
171 171
             'basic-syntax35': (r'{{ var|default_if_none:"foo\now" }}', {"var": None}, r'foo\now'),
172 172
 
  173
+            # Empty strings can be passed as arguments to filters
  174
+            'basic-syntax36': (r'{{ var|join:"" }}', {'var': ['a', 'b', 'c']}, 'abc'),
  175
+
173 176
             ### COMMENT TAG ###########################################################
174 177
             'comment-tag01': ("{% comment %}this is hidden{% endcomment %}hello", {}, "hello"),
175 178
             'comment-tag02': ("{% comment %}this is hidden{% endcomment %}hello{% comment %}foo{% endcomment %}", {}, "hello"),

0 notes on commit 9c0568e

Please sign in to comment.
Something went wrong with that request. Please try again.