From 2b40ed050040bbee3e3b5fc48b73291b2ab0684d Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 7 Feb 2017 17:12:14 -0500 Subject: [PATCH] Prune stubbed out code --- gratipay/models/package/__init__.py | 35 ----------------------------- sql/branch.sql | 4 ---- 2 files changed, 39 deletions(-) delete mode 100644 sql/branch.sql 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 diff --git a/sql/branch.sql b/sql/branch.sql deleted file mode 100644 index 60b32eb8f7..0000000000 --- a/sql/branch.sql +++ /dev/null @@ -1,4 +0,0 @@ -BEGIN; - ALTER TABLE packages ADD COLUMN team_id integer DEFAULT NULL - REFERENCES teams (id) ON UPDATE RESTRICT ON DELETE RESTRICT; -END;