Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/content/course_overviews/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def _create_or_update(cls, course): # lint-amnesty, pylint: disable=too-many-st
# it to be a float like everything else.
if isinstance(course.entrance_exam_minimum_score_pct, int):
course_overview.entrance_exam_minimum_score_pct = course.entrance_exam_minimum_score_pct / 100
else:
elif course.entrance_exam_minimum_score_pct is not None:
course_overview.entrance_exam_minimum_score_pct = course.entrance_exam_minimum_score_pct
Comment thread
jansenk marked this conversation as resolved.
Comment thread
jansenk marked this conversation as resolved.

course_overview.force_on_flexible_peer_openassessments = course.force_on_flexible_peer_openassessments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,16 @@ def test_mongo_course_overview_generation(self):
CourseOverview.load_from_module_store(course_key)
assert CourseOverview.objects.filter(id=course_key).exists()

def test_null_entrance_exam_minimum_score(self):
"""
Tests that course overview can be created when entrance_exam_minimum_score is null.
Comment thread
jansenk marked this conversation as resolved.
"""
course = CourseFactory.create()
course.entrance_exam_minimum_score_pct = None
course_overview = CourseOverview._create_or_update(course) # pylint: disable=protected-access
assert course_overview.entrance_exam_minimum_score_pct == \
CourseOverview.entrance_exam_minimum_score_pct.field.default
Comment thread
jansenk marked this conversation as resolved.


Comment thread
jansenk marked this conversation as resolved.
@ddt.ddt
class CourseOverviewImageSetTestCase(ModuleStoreTestCase):
Expand Down
Loading