Django

Code

Ticket #5270: empty-string.patch

File empty-string.patch, 0.8 kB (added by rnairn@gmail.com, 8 months ago)

Patch to allow empty constant strings as filter arguments

  • template/__init__.py

    old new  
    485485                                           (token[:upto], token[upto:start], token[start:])) 
    486486            if var == None: 
    487487                var, constant, i18n_constant = match.group("var", "constant", "i18n_constant") 
    488                 if i18n_constant
     488                if i18n_constant is not None
    489489                    var = '"%s"' %  _(i18n_constant.replace(r'\"', '"')) 
    490                 elif constant
     490                elif constant is not None
    491491                    var = '"%s"' % constant.replace(r'\"', '"') 
    492492                upto = match.end() 
    493493                if var == None: