Commit 4d29cae4 authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

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

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
parent 6b383afd
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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)