diff --git a/gratipay/models/team/__init__.py b/gratipay/models/team/__init__.py index 56ad8ce03b..45f8e6a270 100644 --- a/gratipay/models/team/__init__.py +++ b/gratipay/models/team/__init__.py @@ -101,10 +101,10 @@ def insert(cls, owner, **fields): INSERT INTO teams (slug, slug_lower, name, homepage, - product_or_service, todo_url, onboarding_url, + product_or_service, onboarding_url, owner) VALUES (%(slug)s, %(slug_lower)s, %(name)s, %(homepage)s, - %(product_or_service)s, %(todo_url)s, %(onboarding_url)s, + %(product_or_service)s, %(onboarding_url)s, %(owner)s) RETURNING teams.*::teams @@ -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/gratipay/utils/fake_data.py b/gratipay/utils/fake_data.py index dc018ac7d7..d5db0c0a15 100644 --- a/gratipay/utils/fake_data.py +++ b/gratipay/utils/fake_data.py @@ -142,6 +142,7 @@ def fake_team(db, teamowner, teamname=None): teamname = faker.first_name() + fake_text_id(3) ctime = teamowner.ctime + datetime.timedelta(days=7) + try: teamslug = slugize(teamname) homepage = 'http://www.example.org/' + fake_text_id(3) @@ -153,7 +154,6 @@ def fake_team(db, teamowner, teamname=None): , homepage=homepage , ctime=ctime , product_or_service=random.sample(productorservice,1)[0] - , todo_url=homepage + '/tickets' , onboarding_url=homepage + '/contributing' , owner=teamowner.username , is_approved=random.sample(isapproved,1)[0] diff --git a/sql/branch.sql b/sql/branch.sql new file mode 100644 index 0000000000..0cf462e947 --- /dev/null +++ b/sql/branch.sql @@ -0,0 +1,5 @@ +--https://github.com/gratipay/gratipay.com/pull/4214 + +BEGIN; + ALTER TABLE teams DROP COLUMN todo_url; +END; 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/tests/py/test_teams.py b/tests/py/test_teams.py index 0fa8452c04..b83ee294b4 100644 --- a/tests/py/test_teams.py +++ b/tests/py/test_teams.py @@ -170,7 +170,6 @@ class TestTeams(Harness): 'product_or_service': 'We make widgets.', 'homepage': 'http://gratipay.com/', 'onboarding_url': 'http://inside.gratipay.com/', - 'todo_url': 'https://github.com/gratipay', 'agree_public': 'true', 'agree_payroll': 'true', 'agree_terms': 'true', @@ -227,12 +226,10 @@ def test_casing_of_urls_survives(self): self.post_new(dict( self.valid_data , homepage='Http://gratipay.com/' , onboarding_url='http://INSIDE.GRATipay.com/' - , todo_url='hTTPS://github.com/GRATIPAY' )) team = T('gratiteam') assert team.homepage == 'Http://gratipay.com/' assert team.onboarding_url == 'http://INSIDE.GRATipay.com/' - assert team.todo_url == 'hTTPS://github.com/GRATIPAY' def test_casing_of_slug_survives(self): self.make_participant('alice', claimed_time='now', email_address='', last_paypal_result='') @@ -301,9 +298,6 @@ def test_error_message_for_bad_url(self): r = self.post_new(dict(self.valid_data, onboarding_url='foo'), expected=400) assert "an http[s]:// URL for the 'Self-onboarding Documentation URL' field." in r.body - r = self.post_new(dict(self.valid_data, todo_url='foo'), expected=400) - assert "Please enter an http[s]:// URL for the 'To-do URL' field." in r.body - def test_error_message_for_invalid_team_name(self): self.make_participant('alice', claimed_time='now', email_address='alice@example.com', last_paypal_result='') data = dict(self.valid_data) @@ -451,7 +445,6 @@ def test_update_works(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', } team.update(**update_data) team = T('enterprise') @@ -460,7 +453,7 @@ def test_update_works(self): def test_can_only_update_allowed_fields(self): allowed_fields = set(['name', 'product_or_service', 'homepage', - 'onboarding_url', 'todo_url']) + 'onboarding_url',]) team = self.make_team(slug='enterprise') 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 diff --git a/www/new.spt b/www/new.spt index b116af13ba..9c39338763 100644 --- a/www/new.spt +++ b/www/new.spt @@ -68,10 +68,6 @@ suppress_sidebar = True ) }}

- -

{{ _("Where can people find a list of available work to do for your Team?") }}

- -

{{ _("Agreements") }}