Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #8031 - url tag no longer silences NoReverseMatch exceptions si…

…nce this is very rarely useful

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c768bc6f25a470f4b555f0f808e9a3b6b1f37066 1 parent 8be1a43
@spookylukey spookylukey authored
View
9 django/template/defaulttags.py
@@ -364,12 +364,9 @@ def render(self, context):
try:
return reverse(self.view_name, args=args, kwargs=kwargs)
except NoReverseMatch:
- try:
- project_name = settings.SETTINGS_MODULE.split('.')[0]
- return reverse(project_name + '.' + self.view_name,
- args=args, kwargs=kwargs)
- except NoReverseMatch:
- return ''
+ project_name = settings.SETTINGS_MODULE.split('.')[0]
+ return reverse(project_name + '.' + self.view_name,
+ args=args, kwargs=kwargs)
class WidthRatioNode(Node):
def __init__(self, val_expr, max_expr, max_width):
View
5 tests/regressiontests/templates/tests.py
@@ -11,6 +11,7 @@
from datetime import datetime, timedelta
from django import template
+from django.core import urlresolvers
from django.template import loader
from django.template.loaders import app_directories, filesystem
from django.utils.translation import activate, deactivate, ugettext as _
@@ -888,8 +889,8 @@ def get_template_tests(self):
# Failures
'url-fail01': ('{% url %}', {}, template.TemplateSyntaxError),
- 'url-fail02': ('{% url no_such_view %}', {}, ''),
- 'url-fail03': ('{% url regressiontests.templates.views.client no_such_param="value" %}', {}, ''),
+ 'url-fail02': ('{% url no_such_view %}', {}, urlresolvers.NoReverseMatch),
+ 'url-fail03': ('{% url regressiontests.templates.views.client %}', {}, urlresolvers.NoReverseMatch),
### CACHE TAG ######################################################
'cache01': ('{% load cache %}{% cache -1 test %}cache01{% endcache %}', {}, 'cache01'),
Please sign in to comment.
Something went wrong with that request. Please try again.