Skip to content

Commit

Permalink
Fix beancount3 duplicate logic
Browse files Browse the repository at this point in the history
With beancount3 the __duplicate__ field can now contain the original
entry instead of "True", mapping this to the old "True" value for the
rest of the import logic to work
  • Loading branch information
tarioch committed Jan 3, 2025
1 parent 20621a8 commit e5d45b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/fava/core/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ def extract_from_file(
entries.sort(key=_incomplete_sortkey)
if isinstance(importer, Importer):
importer.deduplicate(entries, existing=existing_entries)
for entry in entries:
# beangulp importers __duplicate__ metadata contains original entry
# and not True, so map it to True
if entry.meta.pop("__duplicate__", False):
entry.meta["__duplicate__"] = True
return entries


Expand Down

0 comments on commit e5d45b7

Please sign in to comment.