From a41c7d2522c9a7367b232c1adc069dd6aa8b3ad2 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 22 Sep 2021 19:23:58 -0700 Subject: [PATCH] fix logical errors caused by breaking the assumption that there will be at most one payment per person-bug combination. split "donated" out into separate user from lkcl --- budget-sync-config.toml | 9 ++++++++- src/budget_sync/budget_graph.py | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/budget-sync-config.toml b/budget-sync-config.toml index 3f3c0b7..dbbdd68 100644 --- a/budget-sync-config.toml +++ b/budget-sync-config.toml @@ -7,9 +7,16 @@ output_markdown_file = "programmerjake.mdwn" [people."Luke Kenneth Casson Leighton"] email = "lkcl@lkcl.net" -aliases = ["lkcl", "donated", "luke", "Luke", "Luke Leighton"] +aliases = ["lkcl", "luke", "Luke", "Luke Leighton"] output_markdown_file = "lkcl.mdwn" +# for "donated" user, since budget-sync logically +# depends on each person being paid at most once per bug +[people."Luke Kenneth Casson Leighton (donated)"] +email = "donated@lkcl.net" +aliases = ["donated"] +output_markdown_file = "lkcl-donated.mdwn" + [people."NLnet 2019-10P"] email = "2019-10P@nlnet.nl" aliases = [] diff --git a/src/budget_sync/budget_graph.py b/src/budget_sync/budget_graph.py index e2824ee..bfc1d1f 100644 --- a/src/budget_sync/budget_graph.py +++ b/src/budget_sync/budget_graph.py @@ -654,8 +654,9 @@ class BudgetGraph: payment.payee previous_payment = payee_payments.get(payment.payee) if previous_payment is not None: - # NOT AN ERROR - print("NOT AN ERROR", BudgetGraphDuplicatePayeesForTask( + # is an error because budget-sync depends on there + # being at most 1 payment per person-bug combination + errors.append(BudgetGraphDuplicatePayeesForTask( node.bug.id, root.bug.id, previous_payment[-1].payee_key, payment.payee_key)) payee_payments[payment.payee].append(payment) -- 2.30.2