Skip to content

Commit

Permalink
disable checking for generated transactions
Browse files Browse the repository at this point in the history
There is no parse_context_stack for generated transactions, because they
were not parsed from anywhere. This breaks strict checking, because
errors can't be reported.

It doesn't make sense to report errors for these anyway, so lets just
disable them.
  • Loading branch information
taviso authored and jwiegley committed Aug 8, 2024
1 parent efd55c7 commit 185ed90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/draft.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ xact_t * draft_t::insert(journal_t& journal)
xact_t * matching = NULL;
unique_ptr<xact_t> added(new xact_t);

// There is no need to check drafts for errors, because we generated them.
journal.checking_style = journal_t::CHECK_PERMISSIVE;

if (xact_t * xact =
lookup_probable_account(tmpl->payee_mask.str(), journal.xacts.rbegin(),
journal.xacts.rend()).first) {
Expand Down

0 comments on commit 185ed90

Please sign in to comment.