Skip to content

Instantly share code, notes, and snippets.

@claudep
Created February 20, 2015 09:33
Show Gist options
  • Save claudep/2b61e59ac1bcc77ea2d5 to your computer and use it in GitHub Desktop.
Save claudep/2b61e59ac1bcc77ea2d5 to your computer and use it in GitHub Desktop.

Revisions

  1. claudep created this gist Feb 20, 2015.
    5 changes: 5 additions & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    class BDNMiddleware(object):
    def process_exception(self, request, exception):
    """include authenticated user email in request.META"""
    if request.user.is_authenticated():
    request.META['USER_EMAIL'] = request.user.email