diff --git a/www/%participant_id/toggle-is-suspicious.json b/www/%participant_id/toggle-is-suspicious.json index ba5075d119..45fb259611 100644 --- a/www/%participant_id/toggle-is-suspicious.json +++ b/www/%participant_id/toggle-is-suspicious.json @@ -4,14 +4,28 @@ from gittip import db if not user.ADMIN: raise Response(400) -rec = db.fetchone(""" +to = body.get('to') +if not to in ('true', 'false', None): + raise Response(400) + +if to is None: + rec = db.fetchone(""" + + UPDATE participants + SET is_suspicious = (is_suspicious IS NULL) OR (is_suspicious IS false) + WHERE id=%s + RETURNING is_suspicious + + """, (path['participant_id'],)) +else: + rec = db.fetchone(""" - UPDATE participants - SET is_suspicious = (is_suspicious IS NULL) OR (is_suspicious IS false) - WHERE id=%s - RETURNING is_suspicious + UPDATE participants + SET is_suspicious = %s + WHERE id=%s + RETURNING is_suspicious -""", (path['participant_id'],)) + """, (to == 'true', path['participant_id'],)) assert rec is not None diff --git a/www/about/fraud/review.html b/www/about/fraud/review.html new file mode 100644 index 0000000000..a7878f87a1 --- /dev/null +++ b/www/about/fraud/review.html @@ -0,0 +1,78 @@ +from aspen import Response +from gittip import db + +^L +if not user.ADMIN: + raise Response(404) + + +unreviewed = db.fetchall(""" + + SELECT id + , balance + FROM participants + WHERE is_suspicious IS NULL + AND ( last_bill_result IS NOT NULL + OR last_ach_result IS NOT NULL + ) + +""") +if unreviewed is None: + unreviewed = [] +unreviewed = list(unreviewed) + +^L +{% extends templates/base.html %} +{% block body %} + + +

Unreviewed Accounts (N = {{ len(unreviewed) }})

+{% for account in unreviewed %} +
+ + + {{ account['id'] }} +
+{% end %} +
+
+{% end %} +