storage: only try and load grades for students.
authorW. Trevor King <wking@tremily.us>
Thu, 20 Sep 2012 00:37:20 +0000 (20:37 -0400)
committerW. Trevor King <wking@tremily.us>
Thu, 20 Sep 2012 00:37:20 +0000 (20:37 -0400)
pygrader/storage.py

index 51fcaddacf3cba963ff92f988e2e8770c6815ba2..8d3d7683d61a6c596a332140caa9f56bd5bd32ae 100644 (file)
@@ -288,10 +288,11 @@ def load_grades(basedir, assignments, people):
     "Load all grades in a course directory."
     for assignment in assignments:
         for person in people:
-            try:
-                yield load_grade(basedir, assignment, person)
-            except IOError:
-                continue
+            if 'students' in person.groups:
+                try:
+                    yield load_grade(basedir, assignment, person)
+                except IOError:
+                    continue
 
 def load_grade(basedir, assignment, person):
     "Load a single grade from a course directory."