-
Notifications
You must be signed in to change notification settings - Fork 308
Implement a check for whether we posted MassPay #4256
Conversation
Build is failing on #4236. |
Base changed to #4236, builds restarted. |
cfa0d32
to
e5431c3
Compare
#4236 is merged, should base be changed back to master? |
Yup! Done and rebased. Previous was 20156d0. |
20156d0
to
d7425a7
Compare
This looks okay to me as far as I can follow it. @nobodxbodon? |
Rebased again. |
d7425a7
to
80578b8
Compare
JOIN exchange_routes er | ||
ON e.route = er.id | ||
WHERE er.network = 'paypal' | ||
AND e.amount < 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The semantics of the exchanges.amount
field are somewhat goofy (especially as it interacts with the fee
field; see #2442), but fundamentally a negative amount indicates a payout, whereas a positive amount indicates a payin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explaining. Shall we document this in schema.sql (not necessary in this PR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe on http://gratipay.readthedocs.io/?
bin/masspay.py
Outdated
@@ -193,6 +193,11 @@ def post_back_to_gratipay(): | |||
except KeyError: | |||
gratipay_base_url = 'https://gratipay.com' | |||
|
|||
nmasspays = int(requests.get(gratipay_base_url + '/dashboard/nmasspays').text()) | |||
if nmasspays < 10: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this assumes there should be more than 10 teams to pay to? any way to override this without changing code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we want to override it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case that there was no more than 10 teams to pay out to. Or is that impossible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ... theoretically, I suppose. We haven't been below 10 in a long time that I can recall (famous last words). This is the test I came up with to decide whether masspay had been run the previous week or not. I would say in the case where it was run but there were less than 10 payouts, the person running payday could adapt to the situation by manually modifying the script before rerunning. That should be a rare occurrence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Would it be helpful to add some instructions in the print out below, like "if this is a false alarm, please modify xxx manually and rerun"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about 2de1d66?
2de1d66
to
45c791f
Compare
Rebased, was 2de1d66. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
45c791f
to
e5fd92b
Compare
Rebased, was 45c791f. Ready to merge! |
Hopefully will prevent recurrences of gratipay/inside.gratipay.com#951 (comment).