Ticket #16884: message-user-level.diff

File message-user-level.diff, 782 bytes (added by shelldweller, 4 years ago)
  • django/contrib/admin/options.py

     
    672672        change_message = ' '.join(change_message)
    673673        return change_message or _('No fields changed.')
    674674
    675     def message_user(self, request, message):
     675    def message_user(self, request, message, level=messages.INFO):
    676676        """
    677677        Send a message to the user. The default implementation
    678678        posts a message using the django.contrib.messages backend.
    679679        """
    680         messages.info(request, message)
     680        messages.add_message(request, level, message)
    681681
    682682    def save_form(self, request, form, change):
    683683        """
Back to Top