Clean up models, add some error handling

This commit is contained in:
Diana Huang
2013-08-21 15:18:21 -04:00
parent e2ae0b2970
commit bd4cc448af
5 changed files with 15 additions and 18 deletions

View File

@@ -62,7 +62,7 @@ class CourseMode(models.Model):
"""
modes = cls.modes_for_course(course_id)
matched = filter(lambda m: m.slug == mode_slug, modes)
matched = [m for m in modes if m.slug == mode_slug]
if matched:
return matched[0]
else: