From fbc815350fc94330c35c55a9c0b4f212621636b4 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 3 May 2016 20:54:12 -0400 Subject: [PATCH 1/4] move team to a subdir as w/ participant This frees us up to implement additional logic in mixins rather than running away with the team.py file. --- gratipay/models/{team.py => team/__init__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gratipay/models/{team.py => team/__init__.py} (100%) diff --git a/gratipay/models/team.py b/gratipay/models/team/__init__.py similarity index 100% rename from gratipay/models/team.py rename to gratipay/models/team/__init__.py From 6cf220ad4a2dc079668a7ac9819e976caf56cc78 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 3 May 2016 20:54:12 -0400 Subject: [PATCH 2/4] Remove payroll table We never used it anyway. --- sql/branch.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/branch.sql diff --git a/sql/branch.sql b/sql/branch.sql new file mode 100644 index 0000000000..003bc1601e --- /dev/null +++ b/sql/branch.sql @@ -0,0 +1,6 @@ +-- https://github.com/gratipay/gratipay.com/pull/4037 + +BEGIN; + DROP VIEW current_payroll; + DROP TABLE payroll; +END; From a9caaf09c35227ae14425b949eaab22af01172f5 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 11 May 2016 23:03:03 -0400 Subject: [PATCH 3/4] Remove "payroll" from the Python What remains is user-facing in the about pages, etc. --- README.md | 2 +- gratipay/billing/exchanges.py | 2 +- gratipay/billing/payday.py | 2 +- gratipay/models/participant/__init__.py | 4 ++-- gratipay/models/participant/mixins/identity.py | 2 +- gratipay/models/team/__init__.py | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7881bcd302..94a82de87d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status](http://img.shields.io/travis/gratipay/gratipay.com/master.svg)](https://travis-ci.org/gratipay/gratipay.com) [![Open Bounties](https://api.bountysource.com/badge/team?team_id=423&style=bounties_received)](https://www.bountysource.com/teams/gratipay/issues) -[Gratipay](http://gratipay.com) provides payments and payroll for open work, +[Gratipay](http://gratipay.com) provides payments and payouts for open work, in order to cultivate an economy of gratitude, generosity, and love. diff --git a/gratipay/billing/exchanges.py b/gratipay/billing/exchanges.py index c4dec31f6e..0b2ed6856d 100644 --- a/gratipay/billing/exchanges.py +++ b/gratipay/billing/exchanges.py @@ -203,7 +203,7 @@ def get_ready_payout_routes_by_network(db, network): p.status_of_1_0_payout='pending-payout' - ----- TODO: Include members on payroll once process_payroll is implemented + ----- TODO: Include team members once process_takes is implemented ) """, (network,)) diff --git a/gratipay/billing/payday.py b/gratipay/billing/payday.py index 4262c95cba..8fbff87670 100644 --- a/gratipay/billing/payday.py +++ b/gratipay/billing/payday.py @@ -288,7 +288,7 @@ def transfer_takes(cursor, ts_start): @staticmethod def process_draws(cursor): - """Send whatever remains after payroll to the team owner. + """Send whatever remains after payouts to the team owner. """ log("Processing draws.") cursor.run("UPDATE payday_teams SET is_drained=true;") diff --git a/gratipay/models/participant/__init__.py b/gratipay/models/participant/__init__.py index 3c4c09d732..551e60b089 100644 --- a/gratipay/models/participant/__init__.py +++ b/gratipay/models/participant/__init__.py @@ -1,4 +1,4 @@ -"""Participants on Gratipay give payments and take payroll. +"""Participants on Gratipay give payments and take payouts. """ from __future__ import print_function, unicode_literals @@ -1586,7 +1586,7 @@ def to_dict(self, details=False, inquirer=None): # Key: taking # Values: - # 3.00 - user takes this amount in payroll + # 3.00 - user takes this amount from teams output['taking'] = str(self.taking) output['ntaking_from'] = self.ntaking_from diff --git a/gratipay/models/participant/mixins/identity.py b/gratipay/models/participant/mixins/identity.py index ae9b0268f7..50349a2046 100644 --- a/gratipay/models/participant/mixins/identity.py +++ b/gratipay/models/participant/mixins/identity.py @@ -27,7 +27,7 @@ class IdentityMixin(object): A participant may have zero or more national identities on file with Gratipay, with at most one for any given country at any given time. When at least one of a participant's national identities has been verified, then - they may join the payroll of one or more Teams. + they may join one or more Teams. Since national identity information is more sensitive than other information in our database, we encrypt it in the application layer before diff --git a/gratipay/models/team/__init__.py b/gratipay/models/team/__init__.py index 9a0ebac558..22cb3a93c0 100644 --- a/gratipay/models/team/__init__.py +++ b/gratipay/models/team/__init__.py @@ -1,4 +1,4 @@ -"""Teams on Gratipay receive payments and distribute payroll. +"""Teams on Gratipay receive payments and distribute payouts. """ from __future__ import absolute_import, division, print_function, unicode_literals @@ -273,7 +273,7 @@ def update_receiving(self, cursor=None): """, dict(team_id=self.id)) - # This next step is easy for now since we don't have payroll. + # This next step is easy for now since we don't have payouts. from gratipay.models.participant import Participant Participant.from_username(self.owner).update_taking(cursor or self.db) From 5b9590ae72b6c43cd933fa40ae89779ac0ba0dcf Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 2 Jun 2016 13:14:27 -0400 Subject: [PATCH 4/4] Rename a variable in payday for clarity --- gratipay/billing/payday.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gratipay/billing/payday.py b/gratipay/billing/payday.py index 8fbff87670..6fb8ed1e76 100644 --- a/gratipay/billing/payday.py +++ b/gratipay/billing/payday.py @@ -154,7 +154,7 @@ def payin(self): self.process_payment_instructions(cursor) self.transfer_takes(cursor, self.ts_start) self.process_draws(cursor) - payments = cursor.all(""" + _payments_for_debugging = cursor.all(""" SELECT * FROM payments WHERE "timestamp" > %s """, (self.ts_start,)) try: @@ -166,7 +166,7 @@ def payin(self): import csv from time import time with open('%s_payments.csv' % time(), 'wb') as f: - csv.writer(f).writerows(payments) + csv.writer(f).writerows(_payments_for_debugging) raise self.take_over_balances()