Pre-accepted or pre-rejected orgs should stay under 'needs review'
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 14 Mar 2009 16:08:38 +0000
changeset 1851 8ff0858f5b03
parent 1850 1e39b32ff4d7
child 1852 ea2e23e5b7a1
Pre-accepted or pre-rejected orgs should stay under 'needs review' Patch by: Sverre Rabbelier
app/soc/views/models/group_app.py
--- a/app/soc/views/models/group_app.py	Sat Mar 14 16:08:09 2009 +0000
+++ b/app/soc/views/models/group_app.py	Sat Mar 14 16:08:38 2009 +0000
@@ -182,14 +182,16 @@
     list_params = params.copy()
     index = 0
 
-    for choice in selection:
+    for status, action in selection:
       # only select the requests that have been pre-accpeted
-      filter['status'] = choice[0]
+      filter['status'] = status
+
+      name = status[0] if isinstance(status, list) else status
 
       list_params['list_description'] = (
           DEF_APPLICATION_LIST_DESCRIPTION_FMT % (
-          {'name_plural': params['name_plural'], 'status': choice[0]}))
-      list_params['list_action'] = choice[1]
+          {'name_plural': params['name_plural'], 'status': name}))
+      list_params['list_action'] = action
 
       list_content = list_helper.getListContent(
           request, list_params, filter, idx=index)
@@ -223,7 +225,8 @@
       filter['scope_path'] = kwargs['scope_path']
 
     # create the selection list
-    selection = [('needs review', (redirects.getEditRedirect, params)), 
+    selection = [(['needs review', 'pre-accepted', 'pre-rejected'],
+                  (redirects.getEditRedirect, params)),
                  ('accepted', (redirects.getApplicantRedirect, 
                     {'url_name': params['group_url_name']})),
                  ('rejected', (redirects.getPublicRedirect, params))]