Only show budgeted categories on snapshot page

This commit is contained in:
Edgar P. Burkhart 2022-12-21 15:37:57 +01:00
parent 08b3c3dd18
commit 364ad42c05
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -166,9 +166,8 @@ def snapshot(request, uuid=None):
if _snapshot.transactions: if _snapshot.transactions:
context["categories"] = ( context["categories"] = (
_snapshot.transactions.values( _snapshot.transactions.filter(category__budget=True)
"category", "category__name", "category__icon" .values("category", "category__name", "category__icon")
)
.annotate( .annotate(
sum=models.Sum("value"), sum=models.Sum("value"),
sum_m=models.Sum("value", filter=models.Q(value__lt=0)), sum_m=models.Sum("value", filter=models.Q(value__lt=0)),