mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user