Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #20610: Added a message level dict to contrib.message context p…
…rocessor.
- Loading branch information
Showing
5 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,8 +1,12 @@ | |||
from django.contrib.messages.api import get_messages | from django.contrib.messages.api import get_messages | ||
from django.contrib.messages.constants import DEFAULT_LEVELS | |||
|
|
||
|
|
||
def messages(request): | def messages(request): | ||
""" | """ | ||
Returns a lazy 'messages' context variable. | Returns a lazy 'messages' context variable. | ||
""" | """ | ||
return {'messages': get_messages(request)} | return { | ||
'messages': get_messages(request), | |||
'DEFAULT_MESSAGE_LEVELS': DEFAULT_LEVELS, | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters