зеркало из https://github.com/mozilla/FlightDeck.git
added response.META['CURRENT_USER'] to exceptions
This commit is contained in:
Родитель
fa13c5f656
Коммит
b9901d3252
|
@ -253,6 +253,7 @@ MIDDLEWARE_CLASSES = [
|
||||||
'waffle.middleware.WaffleMiddleware',
|
'waffle.middleware.WaffleMiddleware',
|
||||||
'commonware.middleware.FrameOptionsHeader',
|
'commonware.middleware.FrameOptionsHeader',
|
||||||
'commonware.middleware.ScrubRequestOnException',
|
'commonware.middleware.ScrubRequestOnException',
|
||||||
|
'utils.middleware.GetUserInfoOnException',
|
||||||
]
|
]
|
||||||
|
|
||||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
class GetUserInfoOnException(object):
|
||||||
|
|
||||||
|
def process_exception(self, request, exception):
|
||||||
|
|
||||||
|
if request.user:
|
||||||
|
request.META['CURRENT_USER'] = "%s: %s" % \
|
||||||
|
(request.user.pk, request.user.get_profile().nickname)
|
Загрузка…
Ссылка в новой задаче