Move saved message to the base class
This removes some duplicate code that was in all the child
classes of soc.views.models.base.View.
--- a/app/soc/views/models/base.py Thu Nov 20 19:43:31 2008 +0000
+++ b/app/soc/views/models/base.py Thu Nov 20 20:58:46 2008 +0000
@@ -124,6 +124,11 @@
new_params['list_redirect_action'] = '/' + params['url_name'] + '/edit'
+ new_params['save_message'] = [ugettext_lazy('Profile saved.')]
+ new_params['edit_params'] = {
+ self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
+ }
+
self._params = dicts.merge(params, new_params)
def public(self, request, page_name=None, params=None, **kwargs):
--- a/app/soc/views/models/document.py Thu Nov 20 19:43:31 2008 +0000
+++ b/app/soc/views/models/document.py Thu Nov 20 20:58:46 2008 +0000
@@ -117,12 +117,6 @@
params['delete_redirect'] = '/' + params['url_name'] + '/list'
- params['save_message'] = [ugettext_lazy('Profile saved.')]
-
- params['edit_params'] = {
- self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
- }
-
params = dicts.merge(original_params, params)
base.View.__init__(self, params=params)
--- a/app/soc/views/models/home_settings.py Thu Nov 20 19:43:31 2008 +0000
+++ b/app/soc/views/models/home_settings.py Thu Nov 20 20:58:46 2008 +0000
@@ -132,12 +132,6 @@
params['delete_redirect'] = '/' + params['url_name'] + '/list'
- params['save_message'] = [ugettext_lazy('Profile saved.')]
-
- params['edit_params'] = {
- self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
- }
-
params = dicts.merge(original_params, params)
base.View.__init__(self, params=params)
--- a/app/soc/views/models/host.py Thu Nov 20 19:43:31 2008 +0000
+++ b/app/soc/views/models/host.py Thu Nov 20 20:58:46 2008 +0000
@@ -117,12 +117,6 @@
params['delete_redirect'] = '/' + params['url_name'] + '/list'
params['invite_redirect'] = '/request/list'
- params['save_message'] = [ugettext_lazy('Profile saved.')]
-
- params['edit_params'] = {
- self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
- }
-
params = dicts.merge(original_params, params)
role.RoleView.__init__(self, original_params=params)
--- a/app/soc/views/models/request.py Thu Nov 20 19:43:31 2008 +0000
+++ b/app/soc/views/models/request.py Thu Nov 20 20:58:46 2008 +0000
@@ -128,10 +128,6 @@
params['save_message'] = [ugettext_lazy('Request saved.')]
- params['edit_params'] = {
- self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
- }
-
params = dicts.merge(original_params, params)
base.View.__init__(self, params=params)
--- a/app/soc/views/models/sponsor.py Thu Nov 20 19:43:31 2008 +0000
+++ b/app/soc/views/models/sponsor.py Thu Nov 20 20:58:46 2008 +0000
@@ -119,12 +119,6 @@
}
params['delete_redirect'] = '/' + params['url_name'] + '/list'
-
- params['save_message'] = [ugettext_lazy('Profile saved.')]
-
- params['edit_params'] = {
- self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
- }
params = dicts.merge(original_params, params)
--- a/app/soc/views/models/user.py Thu Nov 20 19:43:31 2008 +0000
+++ b/app/soc/views/models/user.py Thu Nov 20 20:58:46 2008 +0000
@@ -145,12 +145,6 @@
params['delete_redirect'] = '/' + params['url_name'] + '/list'
- params['save_message'] = [ugettext_lazy('Profile saved.')]
-
- params['edit_params'] = {
- self.DEF_SUBMIT_MSG_PARAM_NAME: self.DEF_SUBMIT_MSG_PROFILE_SAVED,
- }
-
params = dicts.merge(original_params, params)
base.View.__init__(self, params=params)