From 03b264f50230021031ef70f6d7202d52b95b6de8 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 11 Jan 2017 14:43:06 -0500 Subject: [PATCH] Add projects notice to participant close page --- www/~/%username/settings/close.spt | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/www/~/%username/settings/close.spt b/www/~/%username/settings/close.spt index 7714e78566..ecbe299dc7 100644 --- a/www/~/%username/settings/close.spt +++ b/www/~/%username/settings/close.spt @@ -16,13 +16,9 @@ if request.method == 'POST': else: participant.close() website.redirect('/~%s/' % participant.username) -teams = participant.get_teams() -nteams = len(teams) -if nteams > 1: - teams = ', '.join([t.name for t in teams[:-1]]) + ' and ' + teams[-1].name + ' teams' -elif nteams == 1: - teams = teams[0].name + ' team' - +teams = website.db.all( "SELECT teams.*::teams FROM teams WHERE owner=%s AND NOT is_closed" + , (participant.username,) + ) [---] text/html {% extends "templates/base.html" %} @@ -32,9 +28,12 @@ elif nteams == 1: {% if teams %} -

You are the owner of the {{ teams }}. We don't yet support - team owners closing their accounts.

+

Please close the following projects first:

+ {% endif %} @@ -80,7 +79,7 @@ elif nteams == 1: retention policy).

Things we clear immediately include your profile statement, - the payroll you're taking, and the payments you're giving.

+ the payments you're taking, and the payments you're giving.

We specifically don't delete your past giving and taking history on the site, because that information also belongs