From 4998156a3e3cb9ad6ba5393b6177abf7ffa6c5c6 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 6 Jul 2016 15:56:52 -0400 Subject: [PATCH] Standardize vertical whitespace Conflicts: gratipay/models/team/mixins/takes.py --- gratipay/models/team/mixins/membership.py | 4 ++++ gratipay/models/team/mixins/takes.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/gratipay/models/team/mixins/membership.py b/gratipay/models/team/mixins/membership.py index 284d882599..c452232941 100644 --- a/gratipay/models/team/mixins/membership.py +++ b/gratipay/models/team/mixins/membership.py @@ -16,11 +16,13 @@ def add_member(self, member): raise StubParticipantAdded self.set_take_for(member, Decimal('0.01'), self) + def remove_member(self, member): """Remove a member from this team. """ self.set_take_for(member, Decimal('0.00'), self) + def remove_all_members(self, cursor=None): (cursor or self.db).run(""" INSERT INTO takes (ctime, member, team, amount, recorder) ( @@ -31,6 +33,7 @@ def remove_all_members(self, cursor=None): ); """, dict(username=self.username)) + @property def nmembers(self): return self.db.one(""" @@ -39,6 +42,7 @@ def nmembers(self): WHERE team=%s """, (self.username, )) + def get_members(self, current_participant=None): """Return a list of member dicts. """ diff --git a/gratipay/models/team/mixins/takes.py b/gratipay/models/team/mixins/takes.py index c7ba80929f..78b5a4b1ea 100644 --- a/gratipay/models/team/mixins/takes.py +++ b/gratipay/models/team/mixins/takes.py @@ -28,6 +28,7 @@ def get_take_last_week_for(self, member): """, (self.username, membername), default=Decimal('0.00')) + def get_take_for(self, member): """Return a Decimal representation of the take for this member, or 0. """ @@ -37,6 +38,7 @@ def get_take_for(self, member): , default=Decimal('0.00') ) + def set_take_for(self, member, amount, recorder, cursor=None): """Sets member's take from the team pool. """ @@ -70,6 +72,7 @@ def set_take_for(self, member, amount, recorder, cursor=None): # Update is_funded on member's tips member.update_giving(cursor) + def update_taking(self, old_takes, new_takes, cursor=None, member=None): """Update `taking` amounts based on the difference between `old_takes` and `new_takes`. @@ -91,6 +94,7 @@ def update_taking(self, old_takes, new_takes, cursor=None, member=None): if member and username == member.username: member.set_attributes(**r._asdict()) + def get_current_takes(self, cursor=None): """Return a list of member takes for a team. """