You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(shop): prevent division by zero in product rating calculation
The get_rating method in ProductSerializer did not handle cases where a product
had no reviews, resulting in a ZeroDivisionError.
This fix adds a check to ensure the number of reviews is greater than zero before
performing the division. If there are no reviews, the average rating defaults to 0.0.
0 commit comments