Ticket #5140: propagate_exception_if_debug.patch

File propagate_exception_if_debug.patch, 729 bytes (added by Kenneth Arnold, 16 years ago)

Propagate the NoReverseMatch exception if the reverse lookup fails

  • template/defaulttags.py

     
    368368                project_name = settings.SETTINGS_MODULE.split('.')[0]
    369369                return reverse(project_name + '.' + self.view_name,
    370370                               args=args, kwargs=kwargs)
    371             except NoReverseMatch:
    372                 return ''
     371            except NoReverseMatch, e:
     372                if settings.TEMPLATE_DEBUG:
     373                    raise e
     374                else:
     375                    return ''
    373376
    374377class WidthRatioNode(Node):
    375378    def __init__(self, val_expr, max_expr, max_width):
Back to Top