diff options
| author | Julien Phalip <jphalip@gmail.com> | 2012-01-24 08:02:34 +0000 |
|---|---|---|
| committer | Julien Phalip <jphalip@gmail.com> | 2012-01-24 08:02:34 +0000 |
| commit | 6ae393d74db1f8e553c80951f3eaeb3ba16fc223 (patch) | |
| tree | b76f76575fb5953a10c88732a30c57193c79325d /django | |
| parent | 804bd403838dbd01154f8f477b0ebf2045e7b4b5 (diff) | |
Fixed #15092 -- Made `{% now %}` work with single-quoted string arguments. Thanks to ninja_otoko for the report and to steveire, Aymeric Augustin and Claude Paroz for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17391 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/defaulttags.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 701515a66d..fa54f457c8 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -1049,10 +1049,10 @@ def now(parser, token): It is {% now "jS F Y H:i" %} """ - bits = token.contents.split('"') - if len(bits) != 3: + bits = token.split_contents() + if len(bits) != 2: raise TemplateSyntaxError("'now' statement takes one argument") - format_string = bits[1] + format_string = bits[1][1:-1] return NowNode(format_string) @register.tag |
