Code

Ticket #9847: base.diff

File base.diff, 1.0 KB (added by kgrandis, 5 years ago)
Line 
1Index: django/core/handlers/base.py
2===================================================================
3--- django/core/handlers/base.py        (revision 10180)
4+++ django/core/handlers/base.py        (working copy)
5@@ -4,6 +4,7 @@
6 from django.core import signals
7 from django.utils.encoding import force_unicode
8 from django.utils.importlib import import_module
9+from django.utils.translation import ugettext_lazy as _
10 
11 class BaseHandler(object):
12     # Changes that are always applied to a response (in this order).
13@@ -123,7 +124,8 @@
14                     finally:
15                         receivers = signals.got_request_exception.send(sender=self.__class__, request=request)
16         except exceptions.PermissionDenied:
17-            return http.HttpResponseForbidden('<h1>Permission denied</h1>')
18+            exception_string = _("Permission denied")
19+            return http.HttpResponseForbidden('<h1>%s</h1>' % exception_string )
20         except SystemExit:
21             # Allow sys.exit() to actually exit. See tickets #1023 and #4701
22             raise