Skip to content

Commit

Permalink
do not filter out non-Transaction entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Evernight committed Mar 4, 2025
1 parent 62a8b46 commit 093253f
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 139 deletions.
8 changes: 7 additions & 1 deletion src/fava/core/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import ply.yacc # type: ignore[import-untyped]
from beancount.core import account
from beancount.core.data import Transaction
from beancount.ops.summarize import clamp_opt

from fava.beans.account import get_entry_accounts
Expand Down Expand Up @@ -445,7 +446,11 @@ def __init__(self, value: str) -> None:

def apply(self, entries: Sequence[Directive]) -> Sequence[Directive]:
include = self._include
return [entry for entry in entries if include(entry)]
return [
entry
for entry in entries
if include(entry) or not isinstance(entry, Transaction)
]


class AccountFilter(EntryFilter):
Expand All @@ -472,4 +477,5 @@ def apply(self, entries: Sequence[Directive]) -> Sequence[Directive]:
account.has_component(name, value) or match(name)
for name in get_entry_accounts(entry)
)
or not isinstance(entry, Transaction)
]
Loading

0 comments on commit 093253f

Please sign in to comment.