wg-backend-django/acer-env/lib/python3.10/site-packages/django/contrib/messages/apps.py

19 lines
542 B
Python
Raw Normal View History

2022-11-30 03:58:16 -05:00
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)