Changes between Initial Version and Version 1 of Ticket #23122


Ignore:
Timestamp:
Jul 28, 2014, 3:10:59 PM (10 years ago)
Author:
Tim Graham
Comment:

I disagree as the trend I've observed is to make the template language fail more loudly, not less so. If you strongly disagree, please bring it up on the DevelopersMailingList. Thanks!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23122

    • Property Resolutionwontfix
    • Property Status newclosed
  • Ticket #23122 – Description

    initial v1  
    11
    22Template references to an undefined variable are silently replaced with the empty string:
    3 
     3{{{
    44{{ undefined_variable }}
    5 
     5}}}
    66is replaced by ''
    77
     
    1414
    1515The simple_tag decorator resolves all variables in the context using:
    16 
     16{{{
    1717resolved_vars = [var.resolve(context) for var in self.vars_to_resolve]
    18 
     18}}}
    1919It would be better if this code handled the variable consistently, so that users could switch back and forth from using a templatetag or not and see the same result.  One way would be to replace the above code with the following:
    20 
     20{{{
    2121                    resolved_vars = []
    2222                    for var in self.vars_to_resolve:
     
    2727                        resolved_vars.append(value)
    2828
     29}}}
Back to Top