diff --git a/cms/djangoapps/contentstore/api/views/course_validation.py b/cms/djangoapps/contentstore/api/views/course_validation.py index b0b7ee35329d350eefdc131b0ded0ca5475e412b..ef4bcc718f0eda4598b194a12591e83cdf3eec1b 100644 --- a/cms/djangoapps/contentstore/api/views/course_validation.py +++ b/cms/djangoapps/contentstore/api/views/course_validation.py @@ -139,15 +139,23 @@ class CourseValidationView(DeveloperErrorViewMixin, GenericAPIView): if a.due and a.graded ] - assignments_with_dates_before_start = [ - {'id': unicode(a.location), 'display_name': a.display_name} - for a in assignments_with_dates if a.due < course.start - ] + assignments_with_dates_before_start = ( + [ + {'id': unicode(a.location), 'display_name': a.display_name} + for a in assignments_with_dates if a.due < course.start + ] + if self._has_start_date(course) + else [] + ) - assignments_with_dates_after_end = [ - {'id': unicode(a.location), 'display_name': a.display_name} - for a in assignments_with_dates if a.due > course.end - ] + assignments_with_dates_after_end = ( + [ + {'id': unicode(a.location), 'display_name': a.display_name} + for a in assignments_with_dates if a.due > course.end + ] + if course.end + else [] + ) return dict( total_number=len(assignments),