1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #878 -- URLconf regex captures no longer have to be named groups. Old URLconfs (with named groups) still work. This is backwards-incompatible if you've defined custom middleware with a process_view function. See http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1470 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2005-11-27 22:08:51 +00:00
parent 8c3b41c3e9
commit cc3660c07d
4 changed files with 20 additions and 11 deletions

View File

@@ -62,16 +62,16 @@ class BaseHandler:
resolver = urlresolvers.RegexURLResolver(r'^/', ROOT_URLCONF)
try:
callback, param_dict = resolver.resolve(path)
callback, callback_args, callback_kwargs = resolver.resolve(path)
# Apply view middleware
for middleware_method in self._view_middleware:
response = middleware_method(request, callback, param_dict)
response = middleware_method(request, callback, callback_args, callback_kwargs)
if response:
return response
try:
response = callback(request, **param_dict)
response = callback(request, *callback_args, **callback_kwargs)
except Exception, e:
# If the view raised an exception, run it through exception
# middleware, and if the exception middleware returns a