Skip to content

Commit

Permalink
don't pay debts unless contributor is in the relevant attributions
Browse files Browse the repository at this point in the history
  • Loading branch information
countvajhula committed Mar 30, 2024
1 parent c8c0698 commit 0c81f8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions oldabe/money_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,11 @@ def get_sum_of_advances_by_contributor(attributions):
return advance_totals


def get_payable_debts(unpayable_contributors):
def get_payable_debts(unpayable_contributors, attributions):
debts = read_debts()
debts = [d for d in debts
if not d.is_fulfilled()
and d.email in attributions
and d.email not in unpayable_contributors]
return debts

Expand Down Expand Up @@ -593,7 +594,7 @@ def distribute_payment(payment, attributions):
print(os.listdir(ABE_ROOT))
commit_hash = get_git_revision_short_hash()
unpayable_contributors = get_unpayable_contributors()
payable_debts = get_payable_debts(unpayable_contributors)
payable_debts = get_payable_debts(unpayable_contributors, attributions)
updated_debts, debt_transactions = pay_debts(payable_debts, payment)
# The "available" amount is what is left over after paying off debts
available_amount = payment.amount - sum(t.amount for t in debt_transactions)
Expand Down

0 comments on commit 0c81f8c

Please sign in to comment.