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

Commit

Permalink
Drop onboarding and todo fields from /new
Browse files Browse the repository at this point in the history
Still able to create new team.
  • Loading branch information
mattbk authored and chadwhitacre committed Nov 22, 2016
1 parent 10e9884 commit 565dac0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
6 changes: 2 additions & 4 deletions gratipay/models/team/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ def insert(cls, owner, **fields):
INSERT INTO teams
(slug, slug_lower, name, homepage,
product_or_service, todo_url, onboarding_url,
owner)
product_or_service, owner)
VALUES (%(slug)s, %(slug_lower)s, %(name)s, %(homepage)s,
%(product_or_service)s, %(todo_url)s, %(onboarding_url)s,
%(owner)s)
%(product_or_service)s, %(owner)s)
RETURNING teams.*::teams
""", fields)
Expand Down
15 changes: 6 additions & 9 deletions www/teams/create.json.spt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ field_names = {
'image': 'Image',
'product_or_service': 'Product or Service',
'homepage': 'Homepage',
'onboarding_url': 'Self-onboarding Documentation URL',
'todo_url': 'To-do URL',
}

if user.ANON:
Expand All @@ -40,8 +38,6 @@ or user.participant.is_closed: # sanity checks

if not request.body.get('agree_public', False):
raise Response(400, _("Sorry, you must agree to have your application publicly reviewed."))
if not request.body.get('agree_payroll', False):
raise Response(400, _("Sorry, you must agree to be responsible for payroll."))
if not request.body.get('agree_terms', False):
raise Response(400, _("Sorry, you must agree to the terms of service."))

Expand All @@ -64,11 +60,12 @@ if request.method == 'POST':
raise Response(400, _("Please fill out the '{}' field.", field_names[field]))
fields[field] = value

for field in ('homepage', 'onboarding_url', 'todo_url'):
if not any(map(fields[field].lower().startswith, ('http://', 'https://'))):
raise Response(400, _( "Please enter an http[s]:// URL for the '{}' field."
, field_names[field]
))
# for field in ('homepage'):
# if not any(map(fields['homepage'].lower().startswith, ('http://', 'https://'))):
# raise Response(400, _( "Please enter an http[s]:// URL for the '{}' field."
# , field_names[field]
# ))


try:
fields['slug'] = slugize(fields['name'])
Expand Down

0 comments on commit 565dac0

Please sign in to comment.