handler:submission: fix non-lowercase subject assignment matching.
authorW. Trevor King <wking@tremily.us>
Sat, 1 Sep 2012 14:50:10 +0000 (10:50 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 1 Sep 2012 14:50:10 +0000 (10:50 -0400)
Also accept (and ignore) unrecognized keyword arguments in run().
This will allow interoperability with other handlers which may take
other arguments.

pygrader/handler/submission.py

index 7011f55d2dc68aacc99a30651b243f18b0880ca6..7d1656812e9f232ab7be2e745e743748172232ac 100644 (file)
@@ -23,7 +23,7 @@ from . import respond as _respond
 
 def run(basedir, course, original, message, person, subject,
         max_late=0, respond=None, use_color=None,
-        dry_run=None):
+        dry_run=None, **kwargs):
     """
     >>> from pgp_mime.email import encodedMIMEText
     >>> from pygrader.test.course import StubCourse
@@ -164,7 +164,7 @@ def run(basedir, course, original, message, person, subject,
         max_late=max_late, use_color=use_color, dry_run=dry_run)
 
 def _match_assignment(assignment, subject):
-    return assignment.name.lower() in subject
+    return assignment.name.lower() in subject.lower()
 
 def _save_local_message_copy(msg, person, assignment_path, use_color=None,
                              dry_run=False):