I think you can simplify this as getattr(course, 'syllabus_present', False)