Make sure empty stats are 0
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
270a291f05
commit
d211326c3f
|
@ -336,7 +336,7 @@ def stats(request, year: int = 0):
|
||||||
this_year_spendings = this_year_purchases_without_refunded.aggregate(
|
this_year_spendings = this_year_purchases_without_refunded.aggregate(
|
||||||
total_spent=Sum(F("price"))
|
total_spent=Sum(F("price"))
|
||||||
)
|
)
|
||||||
total_spent = this_year_spendings["total_spent"]
|
total_spent = this_year_spendings["total_spent"] or 0
|
||||||
|
|
||||||
games_with_playtime = (
|
games_with_playtime = (
|
||||||
Game.objects.filter(edition__purchase__session__in=this_year_sessions)
|
Game.objects.filter(edition__purchase__session__in=this_year_sessions)
|
||||||
|
|
Loading…
Reference in New Issue