Project Survey results view now doesn't list all for plain users.
authorLennard de Rijk <ljvderijk@gmail.com>
Tue, 11 Aug 2009 10:22:01 -0700
changeset 2754 efbce6839e90
parent 2753 11d510941d2f
child 2755 e8b599ba7b37
Project Survey results view now doesn't list all for plain users.
app/soc/views/models/project_survey.py
--- a/app/soc/views/models/project_survey.py	Mon Aug 10 18:57:55 2009 -0700
+++ b/app/soc/views/models/project_survey.py	Tue Aug 11 10:22:01 2009 -0700
@@ -303,6 +303,10 @@
       # TODO: this might blow up if the user is org admin for too many orgs
       fields['org'] = organizations
 
+    if not student_entity and not org_admins:
+      # return only the surveys for the current user
+      fields['user'] = user_entity
+
     return fields
 
   @decorators.merge_params