
- Updated `item_incident.html` to implement ERP-style tabs for better navigation and added action icons for editing and deleting incidents. - Enhanced the overview tab with translated labels and improved layout for incident details. - Introduced linked risks and history tabs with appropriate translations and table structures. - Modified `item_risk.html` to include action icons for editing and deleting risks. - Refined `list_controls.html` to improve filter section layout and added translations for filter labels. - Updated `list_incidents.html` to enhance filter functionality and table layout, including translations for headers and buttons. - Improved `list_risks.html` by adding an action icon for adding new risks. - Adjusted `notifications.html` to enhance the display of new notifications with improved formatting and links.
18 lines
665 B
Python
18 lines
665 B
Python
from .audit_context import set_current_user
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# AuditUserMiddleware
|
|
# ---------------------------------------------------------------------------
|
|
class AuditUserMiddleware:
|
|
"""
|
|
Middleware to store the current request.user in thread-local storage.
|
|
Used for auditing (_changed_by, etc.).
|
|
"""
|
|
def __init__(self, get_response):
|
|
self.get_response = get_response
|
|
|
|
def __call__(self, request):
|
|
# Save current user for this request in thread-local storage
|
|
set_current_user(getattr(request, "user", None))
|
|
return self.get_response(request)
|