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

Commit

Permalink
Prune stubbed out code
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Feb 8, 2017
1 parent 9a53034 commit 2b40ed0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
35 changes: 0 additions & 35 deletions gratipay/models/package/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

from gratipay.models.team import Team
from postgres.orm import Model


Expand Down Expand Up @@ -37,37 +36,3 @@ def from_names(cls, package_manager, name):
"""
return cls.db.one("SELECT packages.*::packages FROM packages "
"WHERE package_manager=%s and name=%s", (package_manager, name))


def set_team(self, team):
"""Set team for a package.
"""
if not isinstance(team, Team):
raise NotAllowed("Not a team!")
elif team.is_closed:
raise NotAllowed("team is closed")
elif not team.is_approved:
raise NotAllowed("team not approved")
package_id = self.id
slug = team.slug
with self.db.get_cursor() as c:
# TODO add event
c.run("""
UPDATE packages
SET team=%(slug)s
WHERE id=%(package_id)s
""", locals())
self.set_attributes(team=team)

def set_payment_instruction(self, participant, amount):
team_id = self.team_id
if team_id:
team = Team.from_id(team_id)
participant.set_payment_instruction(team, amount)
else:
# TODO Add to pledges when we introduce it.
pass


class NotAllowed(Exception):
pass
4 changes: 0 additions & 4 deletions sql/branch.sql

This file was deleted.

0 comments on commit 2b40ed0

Please sign in to comment.