fixed zero rating issue
This commit is contained in:
parent
bbd4d20210
commit
200adb2fcf
@ -55,7 +55,7 @@ def recipe_rating(recipe, user):
|
|||||||
if not user.is_authenticated:
|
if not user.is_authenticated:
|
||||||
return ''
|
return ''
|
||||||
rating = recipe.cooklog_set \
|
rating = recipe.cooklog_set \
|
||||||
.filter(created_by=user) \
|
.filter(created_by=user, rating__gte=0) \
|
||||||
.aggregate(Avg('rating'))
|
.aggregate(Avg('rating'))
|
||||||
if rating['rating__avg']:
|
if rating['rating__avg']:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user