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

run Gratipay 150 #3341

Closed
chadwhitacre opened this issue Apr 16, 2015 · 20 comments
Closed

run Gratipay 150 #3341

chadwhitacre opened this issue Apr 16, 2015 · 20 comments

Comments

@chadwhitacre
Copy link
Contributor

149

@chadwhitacre
Copy link
Contributor Author

We should turn off tips to Gratipay for users that were only giving to infinitechan. Surely they don't want to give to Gratipay anymore.

@chadwhitacre
Copy link
Contributor Author

Reviewed 54 (48) accounts.

@chadwhitacre
Copy link
Contributor Author

Backup taken and verified.

@chadwhitacre
Copy link
Contributor Author

Droplet spun up and updated. Still looking at infinitechan tipper tweaks ...

@chadwhitacre
Copy link
Contributor Author

I count 25 users with tips to both infinitechan and Gratipay. Of those, 7 have a tip to a third user.

@chadwhitacre
Copy link
Contributor Author

I count 14 users who only gave to infinitechan and Gratipay, who now have a non-zero tip Gratipay.

@chadwhitacre
Copy link
Contributor Author

We should also issue refunds for their remaining balance, but let's get payday run first.

@chadwhitacre
Copy link
Contributor Author

Okay, here's the script I came up with:

#!/usr/bin/env python
from decimal import Decimal as D
from gratipay import wireup

env = wireup.env()
db = wireup.db(env)

tippers = db.all("""

select distinct on (p.username) p.*::participants
  from participants p
  join current_tips on tipper=p.username
 where tippee='Gratipay'
   and tipper in (
        select tipper
          from current_tips
         where tippee='infinitechan'
    )

""")

for p in tippers:
    other = [t for t in p.get_current_tips() if t['tippee'] not in ('Gratipay', 'infinitechan')]
    gratip = p.get_tip_to('Gratipay')['amount']
    if len(other) == 0 and gratip > 0:
        print len(other), p.get_tip_to('Gratipay')['amount'], p.username
        p.set_tip_to('Gratipay', D('0.00'))

@chadwhitacre
Copy link
Contributor Author

Okay, tip to Gratipay zeroed out for 14 users. Refunding infinitechan tippers reticketed as #3342.

@chadwhitacre
Copy link
Contributor Author

Script started.

@chadwhitacre
Copy link
Contributor Author

Script ran for 17 minutes (0:17:50.957850).

@chadwhitacre
Copy link
Contributor Author

@chadwhitacre
Copy link
Contributor Author

I'm not sure all the emails went out properly.

@chadwhitacre
Copy link
Contributor Author

Log downloaded and droplet destroyed.

@chadwhitacre
Copy link
Contributor Author

MassPay submitted.

@chadwhitacre
Copy link
Contributor Author

MassPay posted back for 93 users. IRC

@chadwhitacre
Copy link
Contributor Author

@chadwhitacre
Copy link
Contributor Author

Escrow shuffled.

@chadwhitacre
Copy link
Contributor Author

Reticketed charge notification emails blockage.

@chadwhitacre
Copy link
Contributor Author

I guess that's that, eh?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant