Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refs #1400 -- Variable resolver now converts literal strings 'False' …

…and 'True' into booleans when used as template arguments. This is point 2 from ticket #1400. Thanks Kieren Holland.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3269 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4d29cae46769745f41283b7f9746326ebdd04338 1 parent 6b383af
@freakboy3742 freakboy3742 authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/template/__init__.py
View
6 django/template/__init__.py
@@ -614,7 +614,11 @@ def resolve_variable(path, context):
(The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.')
"""
- if path[0].isdigit():
+ if path == 'False':
+ path = False
+ elif path == 'True':
+ path = True
+ elif path[0].isdigit():
number_type = '.' in path and float or int
try:
current = number_type(path)
Please sign in to comment.
Something went wrong with that request. Please try again.