Ticket #6269: bettererrorpage.diff

File bettererrorpage.diff, 1.3 KB (added by eibaan <eibaan ät googlemail>, 7 years ago)
  • base.py

     
    5858        from django.core import exceptions, urlresolvers
    5959        from django.core.mail import mail_admins
    6060        from django.conf import settings
     61        try:
     62            # Apply request middleware
     63            for middleware_method in self._request_middleware:
     64                response = middleware_method(request)
     65                if response:
     66                    return response
    6167
    62         # Apply request middleware
    63         for middleware_method in self._request_middleware:
    64             response = middleware_method(request)
    65             if response:
    66                 return response
     68            # Get urlconf from request object, if available.  Otherwise use default.
     69            urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
    6770
    68         # Get urlconf from request object, if available.  Otherwise use default.
    69         urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
     71            resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
    7072
    71         resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
    72         try:
    7373            callback, callback_args, callback_kwargs = resolver.resolve(request.path)
    7474
    7575            # Apply view middleware
Back to Top