Skip to content

Conversation

@Afnarel
Copy link

@Afnarel Afnarel commented Jan 31, 2025

Currently in base.html, jazzmin compares message.tags to hardcoded strings ("success", "error"...) to decide how to display the messages.

According to the documentation, "message tags are used as CSS classes to customize message style based on message type":
https://docs.djangoproject.com/en/5.1/ref/contrib/messages/#message-tags

The MESSAGE_TAGS setting could be overridden in the global settings.py of a project to handle messages in a specific way in other parts of the project (I mean outside jazzmin).

A more reliable way would be to use messages levels that are made available in DEFAULT_MESSAGE_LEVELS:
https://docs.djangoproject.com/en/5.1/ref/contrib/messages/#displaying-messages

This problem was already raised here though the user ended up removing MESSAGE_TAGS from his settings: #344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant