storage: make [course] parameters optional (e.g. no assistants).
authorW. Trevor King <wking@tremily.us>
Thu, 20 Sep 2012 00:08:00 +0000 (20:08 -0400)
committerW. Trevor King <wking@tremily.us>
Thu, 20 Sep 2012 00:15:33 +0000 (20:15 -0400)
pygrader/storage.py

index a5516e9670f8dd007d4194ba33b8b1b23c40f9a1..51fcaddacf3cba963ff92f988e2e8770c6815ba2 100644 (file)
@@ -64,7 +64,8 @@ def load_course(basedir):
     names = {'robot': [config.get('course', 'robot').strip()]}
     for option in ['assignments', 'professors', 'assistants', 'students']:
         names[option] = [
-            a.strip() for a in config.get('course', option).split(',')]
+            a.strip() for a in
+            config.get('course', option, fallback='').split(',')]
         while '' in names[option]:
             names[option].remove('')
     assignments = []