# HG changeset patch # User Sverre Rabbelier # Date 1229174881 0 # Node ID c70d56182ce26b6efa3f293e697db5c7aa31ebe9 # Parent 28225172af063d521022d6f1806059bb87260588 No override needed in notifications.py The only downside is that the ?s=0 parameter will still be appended but is not handled in list(). The right solution would be to update list() so that it does say "Message Sent" or such, to give the user an indication that their message was sent succesfully. Patch by: Sverre Rabbelier diff -r 28225172af06 -r c70d56182ce2 app/soc/views/models/notification.py --- a/app/soc/views/models/notification.py Sat Dec 13 13:27:40 2008 +0000 +++ b/app/soc/views/models/notification.py Sat Dec 13 13:28:01 2008 +0000 @@ -115,34 +115,12 @@ new_params['create_form'] = CreateForm + new_params['edit_redirect'] = '%(url_name)s/list' + params = dicts.merge(params, new_params) super(View, self).__init__(params=params) - def create(self, request, access_type, - page_name=None, params=None, **kwargs): - """On a successful post create redirects the user to the notification list. - - for parameters see base.create() - """ - - if request.method == 'POST': - response = super(View, self).create(request, access_type, - page_name, params, **kwargs) - - if (response.__class__ == http.HttpResponseRedirect and - response['location'].startswith( - '/%s/edit/' %(self._params['url_name']))): - # redirect to list instead of edit view - return http.HttpResponseRedirect('/%s/list' %(self._params['url_name'])) - else: - return response - - else: - # request.method == 'GET' so act normal - return super(View, self).create(request, access_type, - page_name, params, **kwargs) - def list(self, request, access_type, page_name=None, params=None, seed=None, **kwargs): """Lists all notifications that the current logged in user has stored.