diff --git a/www/about/fraud/2012-11-05.html b/www/about/fraud/2012-11-05.html index 772a63fc08..1bb512aa25 100644 --- a/www/about/fraud/2012-11-05.html +++ b/www/about/fraud/2012-11-05.html @@ -9,7 +9,7 @@ ^L _suspicious = db.fetchall(""" - SELECT id + SELECT username , balance , ctime FROM participants @@ -26,7 +26,7 @@ for person in _suspicious: person['gives_to'] = db.fetchall(""" - SELECT DISTINCT tippee AS id + SELECT DISTINCT tippee AS username , is_suspicious , tips.ctime FROM tips @@ -37,10 +37,10 @@ ORDER BY tips.ctime - """, (person['id'],)) + """, (person['username'],)) person['receives_from'] = db.fetchall(""" - SELECT DISTINCT tipper AS id + SELECT DISTINCT tipper AS username , is_suspicious , tips.ctime FROM tips @@ -50,7 +50,7 @@ AND tips.ctime < '2012-11-05'::timestamptz ORDER BY tips.ctime - """, (person['id'],)) + """, (person['username'],)) person['transfers'] = list(db.fetchall(""" @@ -64,7 +64,7 @@ ORDER BY timestamp - """, (person['id'], person['id']))) + """, (person['username'], person['username']))) person['exchanges'] = list(db.fetchall(""" @@ -75,11 +75,11 @@ ORDER BY timestamp - """, (person['id'],))) + """, (person['username'],))) yield person suspicious = list(suspicious()) -names = set([person['id'] for person in suspicious]) +names = set([person['username'] for person in suspicious]) total_charged = 0 total_withdrawn = 0 @@ -155,13 +155,13 @@ bystander_balances = db.fetchall(""" - SELECT id, balance FROM participants WHERE id = ANY(%s) + SELECT username, balance FROM participants WHERE username = ANY(%s) """, (list(bystanders),)) if bystander_balances is None: bystander_balances = [] for row in bystander_balances: - bystanders[row['id']].append(row['balance']) + bystanders[row['username']].append(row['balance']) bystanders = sorted(bystanders.items(), key=lambda i: i[1], reverse=True) @@ -351,20 +351,20 @@

Suspicious Accounts (N = {{ len(suspicious) }})

{% for row in suspicious %} - {{ row['id'] }}
+ {{ row['username'] }}
{{ fmtdate(row['ctime']) }} {{ pad(row['balance'], 5) }} {% for person in row['gives_to'] %} - →{{ person['id'] }}
+ →{{ person['username'] }}
{% end %} {% for person in row['receives_from'] %} - ←{{ person['id'] }}
+ ←{{ person['username'] }}
{% end %} {% for transfer in row['transfers'] %} - {% if row['id'] == transfer['tipper'] %} + {% if row['username'] == transfer['tipper'] %} {{ pad(transfer['amount'], 5)}}{{ transfer['tippee'] }}