Skip to content

Commit b0f93ac

Browse files
authored
add css to alert messages (#1028)
1 parent 9af416f commit b0f93ac

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/eventyay/config/settings.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from pathlib import Path
1919
from urllib.parse import urlparse
2020
import django.conf.locale
21+
from django.contrib.messages import constants as messages # NOQA
2122
from django.utils.translation import gettext_lazy as _
2223
from django.utils.crypto import get_random_string
2324
from kombu import Queue
@@ -899,7 +900,13 @@ def instance_name(request):
899900
CSP_DEFAULT_SRC = ("'self'", "'unsafe-eval'")
900901
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
901902

902-
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"
903+
MESSAGE_TAGS = {
904+
messages.INFO: 'alert-info',
905+
messages.ERROR: 'alert-danger',
906+
messages.WARNING: 'alert-warning',
907+
messages.SUCCESS: 'alert-success',
908+
}
909+
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
903910

904911
# Template configuration
905912
template_loaders = (

0 commit comments

Comments
 (0)