Skip to content

Commit ff28075

Browse files
authored
Merge pull request #3326 from raizasafeel/backport/2699-v15
fix: treat a missing review rating as zero (backport #2699)
2 parents 714fb75 + 929e75c commit ff28075

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)