django-auditlog/auditlog/middleware.py
2024-02-10 15:21:20 +05:30

8 lines
317 B
Python

class AuditlogMiddleware:
"""
Middleware to couple the request's user to log items. This is accomplished by currying the
signal receiver with the user from the request (or None if the user is not authenticated).
"""
def __init__(self, get_response=None):
self.get_response = get_response