FlightDeck/utils/middleware.py

9 строки
263 B
Python

class GetUserInfoOnException(object):
def process_exception(self, request, exception):
if request.user.is_authenticated():
request.META['CURRENT_USER'] = '%s: %s' % \
(request.user.pk, request.user.username)