Fix history regarding category__budget

This commit is contained in:
Edgar P. Burkhart 2024-01-03 16:07:10 +01:00
parent e4169bd1c3
commit ef90d52807
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 6 additions and 6 deletions

View file

@ -41,7 +41,7 @@ class AccountUpdateView(NummiUpdateView):
"new_statement", kwargs={"account": account.pk} "new_statement", kwargs={"account": account.pk}
), ),
"statements": _statements[:8], "statements": _statements[:8],
"history": history(account.transaction_set), "history": history(account.transaction_set.exclude(category__budget=False)),
} }

View file

@ -153,8 +153,8 @@ class TransactionYearView(UserMixin, TransactionACMixin, YearArchiveView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context_data = super().get_context_data(**kwargs) context_data = super().get_context_data(**kwargs)
return context_data | { h_data = context_data["transactions"]
"history": history( if "account" not in self.kwargs and "category" not in self.kwargs:
context_data["transactions"].exclude(category__budget=False) h_data = h_data.exclude(category__budget=False)
),
} return context_data | {"history": history(h_data)}