diff --git a/nummi/account/views.py b/nummi/account/views.py index 446ac30..691bc78 100644 --- a/nummi/account/views.py +++ b/nummi/account/views.py @@ -41,7 +41,7 @@ class AccountUpdateView(NummiUpdateView): "new_statement", kwargs={"account": account.pk} ), "statements": _statements[:8], - "history": history(account.transaction_set), + "history": history(account.transaction_set.exclude(category__budget=False)), } diff --git a/nummi/transaction/views.py b/nummi/transaction/views.py index 2421c12..ad917e2 100644 --- a/nummi/transaction/views.py +++ b/nummi/transaction/views.py @@ -153,8 +153,8 @@ class TransactionYearView(UserMixin, TransactionACMixin, YearArchiveView): def get_context_data(self, **kwargs): context_data = super().get_context_data(**kwargs) - return context_data | { - "history": history( - context_data["transactions"].exclude(category__budget=False) - ), - } + h_data = context_data["transactions"] + if "account" not in self.kwargs and "category" not in self.kwargs: + h_data = h_data.exclude(category__budget=False) + + return context_data | {"history": history(h_data)}