Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Rename process_draws to process_unclaimed
Browse files Browse the repository at this point in the history
Fits the new nomenclature
  • Loading branch information
chadwhitacre committed Jun 2, 2016
1 parent 26549a6 commit 64e6bc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions gratipay/billing/payday.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Payday(object):
create_card_holds
process_payment_instructions
transfer_takes
process_draws
process_unclaimed
settle_card_holds
update_balances
take_over_balances
Expand Down Expand Up @@ -153,7 +153,7 @@ def payin(self):
holds = self.create_card_holds(cursor)
self.process_payment_instructions(cursor)
self.transfer_takes(cursor, self.ts_start)
self.process_draws(cursor)
self.process_unclaimed(cursor)
payments = cursor.all("""
SELECT * FROM payments WHERE "timestamp" > %s
""", (self.ts_start,))
Expand Down Expand Up @@ -287,8 +287,8 @@ def transfer_takes(cursor, ts_start):


@staticmethod
def process_draws(cursor):
"""Send whatever remains after payroll to the team owner.
def process_unclaimed(cursor):
"""Send whatever remains after processing takes claimed by members to the team owner.
"""
log("Processing draws.")
cursor.run("UPDATE payday_teams SET is_drained=true;")
Expand Down
4 changes: 2 additions & 2 deletions tests/py/test_billing_payday.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def test_transfer_takes(self):
else:
assert p.balance == 0

def test_process_draws(self):
def test_process_unclaimed(self):
alice = self.make_participant('alice', claimed_time='now', balance=1)
picard = self.make_participant('picard', claimed_time='now', last_paypal_result='')
Enterprise = self.make_team('The Enterprise', picard, is_approved=True)
Expand All @@ -503,7 +503,7 @@ def test_process_draws(self):
payday.prepare(cursor)
payday.process_payment_instructions(cursor)
payday.transfer_takes(cursor, payday.ts_start)
payday.process_draws(cursor)
payday.process_unclaimed(cursor)
assert cursor.one("select new_balance from payday_participants "
"where username='picard'") == D('0.51')
assert cursor.one("select balance from payday_teams where slug='TheEnterprise'") == 0
Expand Down

0 comments on commit 64e6bc1

Please sign in to comment.