From 5e22e91e2e159dc026ec677beec624da121b18e0 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 25 Aug 2016 12:17:03 -0400 Subject: [PATCH] Include team members in masspay --- gratipay/billing/exchanges.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gratipay/billing/exchanges.py b/gratipay/billing/exchanges.py index 0b2ed6856d..28f0fde0b0 100644 --- a/gratipay/billing/exchanges.py +++ b/gratipay/billing/exchanges.py @@ -198,12 +198,20 @@ def get_ready_payout_routes_by_network(db, network): ) > 0 - OR -- Include green-lit Gratipay 1.0 balances + OR -- Include team members + + (SELECT count(*) + FROM current_takes ct + JOIN teams t ON ct.team_id = t.id + WHERE ct.participant_id = p.id + AND t.is_approved IS TRUE + AND t.is_closed IS NOT TRUE + ) > 0 - p.status_of_1_0_payout='pending-payout' + OR -- Include green-lit Gratipay 1.0 balances - ----- TODO: Include team members once process_takes is implemented + p.status_of_1_0_payout='pending-payout' ) """, (network,))