Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pay out Gitcoin Grants Rounds automatically with a payout script #6476

Merged
merged 9 commits into from
Apr 21, 2020

Conversation

owocki
Copy link
Contributor

@owocki owocki commented Apr 20, 2020

Description

Pay out Gitcoin Grants Rounds automatically with a payout script

Usage:


# finalize amounts & send KYC email
./manage.py payout_round finalize

# send test txn
./manage.py payout_round payout_test

# prepare test payouts for final payout (24 - 72 hours later)
./manage.py payout_round prepare_final_payout

# send final txn
./manage.py payout_round payout_dai
Refers/Fixes

#5382

Testing

use the commands above, or to test just the emails try

from marketing.mails import *
from grants.models import CLRMatch

match = CLRMatch.objects.filter(round_number=5).first()
grant_match_distribution_kyc(match)
grant_match_distribution_test_txn(match)
grant_match_distribution_final_txn(match)

@codecov
Copy link

codecov bot commented Apr 20, 2020

Codecov Report

Merging #6476 into stable will decrease coverage by 0.13%.
The diff coverage is 10.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           stable    #6476      +/-   ##
==========================================
- Coverage   27.20%   27.06%   -0.14%     
==========================================
  Files         289      290       +1     
  Lines       26473    26691     +218     
  Branches     3924     3954      +30     
==========================================
+ Hits         7201     7223      +22     
- Misses      19005    19197     +192     
- Partials      267      271       +4     
Impacted Files Coverage Δ
app/app/utils.py 24.54% <ø> (ø)
...nts/management/commands/ingest_givingblock_txns.py 0.00% <0.00%> (ø)
app/grants/management/commands/payout_round.py 0.00% <0.00%> (ø)
app/marketing/mails.py 11.55% <6.97%> (-0.21%) ⬇️
app/grants/models.py 49.17% <71.42%> (+0.58%) ⬆️
app/app/settings.py 81.98% <100.00%> (+0.33%) ⬆️
app/grants/admin.py 43.62% <100.00%> (+1.15%) ⬆️
app/dashboard/views.py 11.25% <0.00%> (ø)
...rketing/management/commands/no_applicants_email.py 0.00% <0.00%> (ø)
...eting/management/commands/assemble_leaderboards.py 40.48% <0.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update feeb7c1...85ea6ef. Read the comment docs.

Copy link
Contributor

@danlipert danlipert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two notes but looks good

subscription.is_postive_vote = True
subscription.active = False
subscription.error = True
subscription.contributor_address = '/NA'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats this string mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fat finger of n/a

coupon = "Pick up ONE item of Gitcoin Schwag at http://store.gitcoin.co/ at 50% off with coupon code {settings.GRANTS_COUPON_50_OFF}"
if match.amount > 1000:
coupon = "Pick up ONE item of Gitcoin Schwag at http://store.gitcoin.co/ at 100% off with coupon code {settings.GRANTS_COUPON_100_OFF}"
# NOTE: WE WILL SCREEN AND APPROVE ANY ORDERS TO THE STORE, SO IF YOURE A CLEVER BISCOUT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL - i think we actually dont have to worry about this, since they are set as ENV vars :) you should make the default worth 10% off or something though and add a message here saying since you were reading our codebase you get a discount!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe ill make a 100% off code with a limit of 1 or 2 purchases and sneak it in here as an easter egg.

@owocki owocki merged commit a976ae2 into stable Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants