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

Add script to fix stale cached values #3980

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions sql/branch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from gratipay import wireup

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

participants = db.all("""
SELECT p.*::participants
FROM participants p
JOIN payment_instructions pi ON pi.participant = p.username -- Only include those with tips
""")
total = len(participants)
counter = 0

for p in participants:
print("Participant %s/%s" % (counter, total))
p.update_giving_and_teams()
counter += 1