Ticket #21935: 0001-Add-theobjecttodatausedforthemessage.patch

File 0001-Add-theobjecttodatausedforthemessage.patch, 770 bytes (added by david.fischer.ch@…, 11 years ago)

The patch for this contribution

  • django/contrib/messages/views.py

    From 4c6bb93770cd2a4acb10b83a83458bb821ebafee Mon Sep 17 00:00:00 2001
    From: David Fischer <david.fischer.ch@gmail.com>
    Date: Wed, 30 Oct 2013 15:41:41 +0100
    Subject: [PATCH] Add the object to data used for the message
    
    ---
     django/contrib/messages/views.py | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/django/contrib/messages/views.py b/django/contrib/messages/views.py
    index 3c2ca35..a0e3bd6 100644
    a b class SuccessMessageMixin(object):  
    1515        return response
    1616
    1717    def get_success_message(self, cleaned_data):
     18        if hasattr(self, 'object'):
     19            cleaned_data['object'] = self.object
    1820        return self.success_message % cleaned_data
Back to Top