Ticket #6228: 6941_common_middleware_urlresolver.patch

File 6941_common_middleware_urlresolver.patch, 1011 bytes (added by Trey, 17 years ago)

common middleware patch

  • django/middleware/common.py

     
    5454        # trailing slash and there is no pattern for the current path
    5555        if settings.APPEND_SLASH and (not old_url[1].endswith('/')):
    5656            try:
    57                 urlresolvers.resolve(request.path)
     57                urlresolvers.resolve(request.path, getattr(request, 'urlconf', None))
    5858            except urlresolvers.Resolver404:
    5959                new_url[1] = new_url[1] + '/'
    6060                if settings.DEBUG and request.method == 'POST':
     
    6969        if new_url != old_url:
    7070            # Redirect if the target url exists
    7171            try:
    72                 urlresolvers.resolve(new_url[1])
     72                urlresolvers.resolve(new_url[1], getattr(request, 'urlconf', None))
    7373            except urlresolvers.Resolver404:
    7474                pass
    7575            else:
Back to Top