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:
context["categories"] = (
_snapshot.transactions.values(
"category", "category__name", "category__icon"
)
_snapshot.transactions.filter(category__budget=True)
.values("category", "category__name", "category__icon")
.annotate(
sum=models.Sum("value"),
sum_m=models.Sum("value", filter=models.Q(value__lt=0)),