mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #11960 -- Improved error message for redirects. Thanks, mattmcc
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -49,6 +49,9 @@ def redirect(to, *args, **kwargs):
|
||||
try:
|
||||
return redirect_class(urlresolvers.reverse(to, args=args, kwargs=kwargs))
|
||||
except urlresolvers.NoReverseMatch:
|
||||
# If this is a callable, re-raise.
|
||||
if callable(to):
|
||||
raise
|
||||
# If this doesn't "feel" like a URL, re-raise.
|
||||
if '/' not in to and '.' not in to:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user