From e8e08605f142f3c1be001c8ad6a27156957e0e28 Mon Sep 17 00:00:00 2001 From: wes Date: Sat, 6 May 2017 16:26:34 -0400 Subject: [PATCH] check for False in books --- crawler/mapping.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crawler/mapping.py b/crawler/mapping.py index b239864..c6ce76f 100755 --- a/crawler/mapping.py +++ b/crawler/mapping.py @@ -61,8 +61,9 @@ def toBook(book): def indexCourse(course): print "Trying to index course %s" % course + print course.books new_course = Course(sections=map(toSection, course.sections), - books=map(toBook, course.books), + books=map(toBook, course.books if course.books else []), title=course.title, dept=course.dept, code=course.code)