The listing of accepted projects on the Organization's homepage is now timeline dependent.
authorLennard de Rijk <ljvderijk@gmail.com>
Sat, 18 Apr 2009 14:00:30 +0000
changeset 2207 f283f7b99427
parent 2206 4daf85a152ca
child 2208 1bf4e904d5f5
The listing of accepted projects on the Organization's homepage is now timeline dependent. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
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)