From 6b357c8dedec358211d1279de2181138f120c0b5 Mon Sep 17 00:00:00 2001 From: Jessa Witzel Date: Thu, 1 Dec 2016 01:38:05 -0500 Subject: [PATCH] issue #4214 --- gratipay/models/team/__init__.py | 5 ++--- gratipay/testing/harness.py | 6 ++---- tests/py/test_team_edit.py | 6 +----- www/%team/edit/edit.json.spt | 3 +-- www/%team/edit/index.html.spt | 3 --- www/%team/index.html.spt | 4 ---- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/gratipay/models/team/__init__.py b/gratipay/models/team/__init__.py index 496a6978d8..45f8e6a270 100644 --- a/gratipay/models/team/__init__.py +++ b/gratipay/models/team/__init__.py @@ -170,7 +170,7 @@ def get_payment_distribution(self): def update(self, **kw): updateable = frozenset(['name', 'product_or_service', 'homepage', - 'onboarding_url', 'todo_url']) + 'onboarding_url']) cols, vals = zip(*kw.items()) assert set(cols).issubset(updateable) @@ -320,8 +320,7 @@ def to_dict(self): 'owner': '~' + self.owner, 'receiving': self.receiving, 'slug': self.slug, - 'status': self.status, - 'todo_url': self.todo_url + 'status': self.status } diff --git a/gratipay/testing/harness.py b/gratipay/testing/harness.py index 503bae3f02..0a5b0a56ea 100644 --- a/gratipay/testing/harness.py +++ b/gratipay/testing/harness.py @@ -168,10 +168,10 @@ def make_team(self, *a, **kw): team = self.db.one(""" INSERT INTO teams - (slug, slug_lower, name, homepage, product_or_service, todo_url, + (slug, slug_lower, name, homepage, product_or_service, onboarding_url, owner, is_approved, available) VALUES (%(slug)s, %(slug_lower)s, %(name)s, %(homepage)s, %(product_or_service)s, - %(todo_url)s, %(onboarding_url)s, %(owner)s, %(is_approved)s, + %(onboarding_url)s, %(owner)s, %(is_approved)s, %(available)s) RETURNING teams.*::teams """, _kw) @@ -321,5 +321,3 @@ def get_tip(self, tipper, tippee): LIMIT 1 """, (tipper, tippee), back_as=dict, default=default)['amount'] - - diff --git a/tests/py/test_team_edit.py b/tests/py/test_team_edit.py index 79eed96af4..417f82aaa9 100644 --- a/tests/py/test_team_edit.py +++ b/tests/py/test_team_edit.py @@ -242,7 +242,6 @@ def test_edit(self): 'product_or_service': 'We save galaxies.', 'homepage': 'http://starwars-enterprise.com/', 'onboarding_url': 'http://starwars-enterprise.com/onboarding', - 'todo_url': 'http://starwars-enterprise.com/todos', 'image': FileUpload(IMAGE, 'logo.png'), } data = json.loads(self.client.POST( '/enterprise/edit/edit.json' @@ -256,7 +255,6 @@ def test_edit(self): assert team.product_or_service == 'We save galaxies.' assert team.homepage == 'http://starwars-enterprise.com/' assert team.onboarding_url == 'http://starwars-enterprise.com/onboarding' - assert team.todo_url == 'http://starwars-enterprise.com/todos' assert team.load_image('original') == IMAGE def test_edit_supports_partial_updates(self): @@ -275,7 +273,6 @@ def test_edit_supports_partial_updates(self): assert team.product_or_service == 'We save galaxies.' assert team.homepage == 'http://starwars-enterprise.com/' assert team.onboarding_url == '' - assert team.todo_url == '' assert team.load_image('original') == IMAGE def test_edit_needs_auth(self): @@ -332,7 +329,7 @@ def test_can_edit_teams_under_review(self): def test_can_only_edit_allowed_fields(self): allowed_fields = set(['name', 'image', 'product_or_service', - 'homepage', 'onboarding_url', 'todo_url']) + 'homepage', 'onboarding_url']) team = self.make_team(slug='enterprise', is_approved=None) @@ -398,7 +395,6 @@ def test_edit_with_empty_data_does_nothing(self): 'product_or_service': 'We save galaxies.', 'homepage': 'http://starwars-enterprise.com/', 'onboarding_url': 'http://starwars-enterprise.com/onboarding', - 'todo_url': 'http://starwars-enterprise.com/todos', } self.make_team(**team_data) r = self.client.POST( '/enterprise/edit/edit.json' diff --git a/www/%team/edit/edit.json.spt b/www/%team/edit/edit.json.spt index b9ba8f074c..e7f92830ad 100644 --- a/www/%team/edit/edit.json.spt +++ b/www/%team/edit/edit.json.spt @@ -21,7 +21,6 @@ field_names = { 'product_or_service': 'Product or Service', 'homepage': 'Homepage', 'onboarding_url': 'Self-onboarding Documentation URL', - 'todo_url': 'To-do URL', } if user.ANON: @@ -54,7 +53,7 @@ for field in data.keys(): if not value: raise Response(400, _("Please fill out the '{}' field.", field_names[field])) - if (field in ('homepage', 'onboarding_url', 'todo_url') + if (field in ('homepage', 'onboarding_url') and not valid_url(value)): raise Response(400, _( "Please enter an http[s]:// URL for the '{}' field." diff --git a/www/%team/edit/index.html.spt b/www/%team/edit/index.html.spt index a721cf3ad7..351574ac69 100644 --- a/www/%team/edit/index.html.spt +++ b/www/%team/edit/index.html.spt @@ -60,9 +60,6 @@ suppress_sidebar = True - - -

diff --git a/www/%team/index.html.spt b/www/%team/index.html.spt index 6517aef79f..b6b9665b8e 100644 --- a/www/%team/index.html.spt +++ b/www/%team/index.html.spt @@ -45,10 +45,6 @@ is_team_owner = not user.ANON and team.owner == user.participant.username | {{ _("Onboarding") }} {% endif %} - {% if team.todo_url %} - | {{ _("To-do") }} - {% endif %} - {% if user.ADMIN or is_team_owner %} |{{ _( "{a} Edit team {_a}" , a=''|safe