wg-backend-django/dell-env/lib/python3.11/site-packages/django/contrib/messages/apps.py
2023-10-30 14:40:43 +07:00

19 lines
542 B
Python

from django.apps import AppConfig
from django.contrib.messages.storage import base
from django.contrib.messages.utils import get_level_tags
from django.core.signals import setting_changed
from django.utils.translation import gettext_lazy as _
def update_level_tags(setting, **kwargs):
if setting == "MESSAGE_TAGS":
base.LEVEL_TAGS = get_level_tags()
class MessagesConfig(AppConfig):
name = "django.contrib.messages"
verbose_name = _("Messages")
def ready(self):
setting_changed.connect(update_level_tags)