diff --git a/gratipay/models/package/__init__.py b/gratipay/models/package/__init__.py index a93fc25e31..64eda95ba7 100644 --- a/gratipay/models/package/__init__.py +++ b/gratipay/models/package/__init__.py @@ -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 @@ -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