Skip to content

Commit 929e75c

Browse files
committed
fix: treat a missing review rating as zero
1 parent 714fb75 commit 929e75c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lms/lms/utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def _course_reviews(course: str) -> list:
415415
)
416416
out_of_ratings = (len(out_of_ratings) and out_of_ratings[0].options) or 5
417417
for review in reviews:
418-
review.rating = review.rating * out_of_ratings
418+
review.rating = (review.rating or 0) * out_of_ratings
419419
review.owner_details = frappe.db.get_value(
420420
"User", review.owner, ["username", "full_name", "user_image"], as_dict=True
421421
)

0 commit comments

Comments
 (0)