# HG changeset patch # User Lennard de Rijk # Date 1240063230 0 # Node ID f283f7b9942786ebe5f3b62f9d9bdae2e50598ea # Parent 4daf85a152ca6acdc39962d6f5b179399c5d0a55 The listing of accepted projects on the Organization's homepage is now timeline dependent. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed diff -r 4daf85a152ca -r f283f7b99427 app/soc/views/models/organization.py --- a/app/soc/views/models/organization.py Sat Apr 18 13:59:24 2009 +0000 +++ b/app/soc/views/models/organization.py Sat Apr 18 14:00:30 2009 +0000 @@ -390,29 +390,33 @@ from soc.views.models import student_project as student_project_view - ap_params = student_project_view.view.getParams().copy() # accepted projects + program_entity = entity.scope + + if timeline_helper.isAfterEvent(program_entity.timeline, + 'accepted_students_announced_deadline'): + ap_params = student_project_view.view.getParams().copy() # accepted projects - # define the list redirect action to show the notification - ap_params['list_action'] = (redirects.getPublicRedirect, ap_params) - ap_params['list_description'] = self.DEF_ACCEPTED_PROJECTS_MSG_FMT % ( - entity.name) - ap_params['list_heading'] = 'soc/student_project/list/heading.html' - ap_params['list_row'] = 'soc/student_project/list/row.html' + # define the list redirect action to show the notification + ap_params['list_action'] = (redirects.getPublicRedirect, ap_params) + ap_params['list_description'] = self.DEF_ACCEPTED_PROJECTS_MSG_FMT % ( + entity.name) + ap_params['list_heading'] = 'soc/student_project/list/heading.html' + ap_params['list_row'] = 'soc/student_project/list/row.html' - # only show projects that have not failed - filter = {'scope': entity, - 'status': ['accepted', 'mid_term_passed', 'passed']} + # only show projects that have not failed + filter = {'scope': entity, + 'status': ['accepted', 'mid_term_passed', 'passed']} - ap_list = lists.getListContent(request, ap_params, filter, idx=0, - need_content=True) + ap_list = lists.getListContent(request, ap_params, filter, idx=0, + need_content=True) - contents = [] + contents = [] - if ap_list: - contents.append(ap_list) + if ap_list: + contents.append(ap_list) - # construct the list and put it into the context - context['list'] = soc.logic.lists.Lists(contents) + # construct the list and put it into the context + context['list'] = soc.logic.lists.Lists(contents) return super(View, self)._public(request=request, entity=entity, context=context)