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

Commit

Permalink
Standardize vertical whitespace
Browse files Browse the repository at this point in the history
Conflicts:
	gratipay/models/team/mixins/takes.py
  • Loading branch information
chadwhitacre committed Jul 6, 2016
1 parent 1ecff7e commit 4998156
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gratipay/models/team/mixins/membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) (
Expand All @@ -31,6 +33,7 @@ def remove_all_members(self, cursor=None):
);
""", dict(username=self.username))


@property
def nmembers(self):
return self.db.one("""
Expand All @@ -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.
"""
Expand Down
4 changes: 4 additions & 0 deletions gratipay/models/team/mixins/takes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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.
"""
Expand Down Expand Up @@ -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`.
Expand All @@ -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.
"""
Expand Down

0 comments on commit 4998156

Please sign in to comment.