Why not `if course_id:`? 
Also, what if `course_id` is `'    '`?