# HG changeset patch # User Sverre Rabbelier # Date 1228240784 0 # Node ID 355ac73823a1c716071602cfbcffd7a1720fff9b # Parent 860e17e5118f2f9fafaa9f94237d56694f43ab45 Swap order of merged params to fix sponsor select view The sponsor select view (in 'create new program') was showing the wrong information (and also using the wrong list template) because the order in which the params were merged was wrong way around. This fixes that and at the same time fixes the 'instruction_text' attribute, which should be named 'list_description' instead. At the same time we lookup and set Sponsor as the scope of the newly created program. Patch by: Sverre Rabbelier diff -r 860e17e5118f -r 355ac73823a1 app/soc/views/models/program.py --- a/app/soc/views/models/program.py Tue Dec 02 17:14:18 2008 +0000 +++ b/app/soc/views/models/program.py Tue Dec 02 17:59:44 2008 +0000 @@ -115,11 +115,11 @@ new_params = {} new_params['list_action'] = (redirects.getCreateProgramRedirect, params) - new_params['instruction_text'] = \ + new_params['list_description'] = \ self.DEF_CREATE_INSTRUCTION_MSG_FMT % self._params + new_params = dicts.merge(new_params, sponsor_view.view._params) params = dicts.merge(new_params, params) - params = dicts.merge(params, sponsor_view.view._params) content = helper.lists.getListContent(request, params, sponsor_logic.logic) contents = [content] @@ -133,6 +133,14 @@ # fill in the email field with the data from the entity form.fields['scope_path'].initial = entity.scope_path + def _editPost(self, request, entity, fields): + """See base.View._editPost(). + """ + + sponsor = sponsor_logic.logic.getFromFields(link_id=fields['scope_path']) + fields['scope'] = sponsor + + def getDjangoURLPatterns(self, params=None): """See base.View.getDjangoURLPatterns(). """ diff -r 860e17e5118f -r 355ac73823a1 app/soc/views/models/role.py --- a/app/soc/views/models/role.py Tue Dec 02 17:14:18 2008 +0000 +++ b/app/soc/views/models/role.py Tue Dec 02 17:59:44 2008 +0000 @@ -93,7 +93,7 @@ new_params['list_action'] = (redirects.getCreateRequestRedirect, {'group_scope' : group_scope, 'url_name' : self._params['url_name'] }) - new_params['instruction_text'] = \ + new_params['list_description'] = \ self.DEF_INVITE_INSTRUCTION_MSG_FMT % self._params new_params = dicts.merge(new_params, params)