Ticket #18169: 18169.diff

File 18169.diff, 989 bytes (added by jasisz, 3 years ago)
  • a/django/template/base.py

    diff --git a/django/template/base.py b/django/template/base.py
    index e2fc66b..f07ce86 100644
    class Variable(object): 
    744744        detail and shouldn't be called by external code. Use Variable.resolve()
    745745        instead.
    746746        """
     747        from django.core.urlresolvers import reverse, NoReverseMatch
    747748        current = context
    748749        try:  # catch-all for silent variable failures
    749750            for bit in self.lookups:
    class Variable(object): 
    774775                            # GOTCHA: This will also catch any TypeError
    775776                            # raised in the function itself.
    776777                            current = settings.TEMPLATE_STRING_IF_INVALID  # invalid method call
     778        except NoReverseMatch, e:
     779            raise e
    777780        except Exception, e:
    778781            if getattr(e, 'silent_variable_failure', False):
    779782                current = settings.TEMPLATE_STRING_IF_INVALID
Back to Top