Permalink
Browse files

Merge pull request #926 from benjaoming/master

0.4.x into master
  • Loading branch information...
benjaoming committed Oct 26, 2018
2 parents 2043d04 + 4a634b0 commit b37e0adea19d4ccab14cdf196330e26b2889d576
Showing with 16 additions and 11 deletions.
  1. +9 −0 docs/release_notes.rst
  2. +6 −6 src/wiki/conf/settings.py
  3. +1 −5 src/wiki/templatetags/wiki_tags.py
@@ -20,6 +20,15 @@ Changed
* Update to Markdown >= 3 :url-issue:`920` (Don Bowman)
0.4.2
-----
Security
~~~~~~~~
* Using customized ``MESSAGE_TAGS`` setting caused ``KEY_ERROR`` :url-issue:`922` (Benjamin Bach)
0.4.1
-----
@@ -159,16 +159,16 @@
#: Do we want to log IPs of logged in users?
LOG_IPS_USERS = getattr(django_settings, 'WIKI_LOG_IPS_USERS', False)
#: Mapping from message.tag to bootstrap class names.
#: Mapping from message.level to bootstrap class names.
MESSAGE_TAG_CSS_CLASS = getattr(
django_settings,
'WIKI_MESSAGE_TAG_CSS_CLASS',
{
messages.DEFAULT_TAGS[messages.DEBUG]: "alert alert-info",
messages.DEFAULT_TAGS[messages.ERROR]: "alert alert-danger",
messages.DEFAULT_TAGS[messages.INFO]: "alert alert-info",
messages.DEFAULT_TAGS[messages.SUCCESS]: "alert alert-success",
messages.DEFAULT_TAGS[messages.WARNING]: "alert alert-warning",
messages.DEBUG: "alert alert-info",
messages.ERROR: "alert alert-danger",
messages.INFO: "alert alert-info",
messages.SUCCESS: "alert alert-success",
messages.WARNING: "alert alert-warning",
}
)
@@ -80,11 +80,7 @@ def wiki_messages(context):
messages = context.get('messages', [])
for message in messages:
message.css_class = ""
for tag in message.tags.split(" "):
# Drop KeyError if MESSAGE_TAG_CSS_CLASS doesn't have the tag,
# that seems valuable.
message.css_class += " " + settings.MESSAGE_TAG_CSS_CLASS[tag]
message.css_class = settings.MESSAGE_TAG_CSS_CLASS[message.level]
context.update({
'messages': messages
})

0 comments on commit b37e0ad

Please sign in to comment.