This commit is contained in:
Holger Sielaff
2025-08-27 09:55:55 +02:00
commit 90c0ff61ed
107 changed files with 8535 additions and 0 deletions

13
lib/messages.py Normal file
View File

@@ -0,0 +1,13 @@
from django_middleware_global_request import get_request
from django.contrib import messages
import logging
def __getattr__(name):
def wrapper(*args, **kwargs):
request = get_request()
getattr(logging, name, logging.info)(*args)
return getattr(messages, name)(request, *args, **kwargs)
if hasattr(messages, name):
return wrapper
raise AttributeError(f"'{__name__}' object has no attribute '{name}'")