Fixes an issue where the organization home page would throw a 505 when no projects where accepted.
authorLennard de Rijk <ljvderijk@gmail.com>
Mon, 22 Jun 2009 07:32:45 +0200
changeset 2418 32cb30846cfd
parent 2417 d286202a1039
child 2419 82ce842da661
Fixes an issue where the organization home page would throw a 505 when no projects where accepted. This only happens after the project announced deadline because only then would the project list be constructed.
app/soc/views/models/organization.py
--- a/app/soc/views/models/organization.py	Sun Jun 21 18:27:30 2009 +0200
+++ b/app/soc/views/models/organization.py	Mon Jun 22 07:32:45 2009 +0200
@@ -498,14 +498,14 @@
       ap_list = lists.getListContent(request, ap_params, filter, idx=0,
                                      need_content=True)
 
-      # this is a temporary fix for sorting Student Projects 
-      # by Student name until we have a view that default 
-      # sorts it self by name (right now we can't do such query)
-      ap_list['data'].sort(key=lambda sp: sp.student.name().lower())
-      
       contents = []
 
       if ap_list:
+        # this is a temporary fix for sorting Student Projects 
+        # by Student name until we have a view that default 
+        # sorts it self by name (right now we can't do such query)
+        ap_list['data'].sort(key=lambda sp: sp.student.name().lower())
+
         contents.append(ap_list)
 
       # construct the list and put it into the context