From 4cef12f77d73303226ea5ebc8889f6c2cc4ca958 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 13 Oct 2015 15:03:54 +0200 Subject: Use identifiers instead of names in get_stat Names have been removed from the database. This code will be updated when we decide what statistics to present to the user. --- server/user_session.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server') diff --git a/server/user_session.py b/server/user_session.py index 9d8a675..41c77ac 100644 --- a/server/user_session.py +++ b/server/user_session.py @@ -266,9 +266,9 @@ class UserSession(object): cur.execute("""select * from( (SELECT distinct - l.name as language, + l.identifier as language, pg.id as problem_group_id, - pg.name as problem_group, + pg.identifier as problem_group, count(distinct p.id) as all, count(CASE s.done WHEN true THEN true END) as done, count(CASE s.done WHEN false THEN true END) as in_progress @@ -276,11 +276,11 @@ class UserSession(object): INNER JOIN language l ON p.language_id = l.id INNER JOIN problem_group pg ON p.problem_group_id = pg.id LEFT JOIN solution s ON s.problem_id = p.id AND s.codeq_user_id = %s - GROUP BY l.name, pg.id, pg.name) + GROUP BY l.identifier, pg.id, pg.identifier) UNION ALL (SELECT distinct - l.name as language, + l.identifier as language, 0 as problem_group_id, null as problem_group, count(distinct p.id) as all, @@ -289,7 +289,7 @@ class UserSession(object): FROM problem p INNER JOIN language l ON p.language_id = l.id LEFT JOIN solution s ON s.problem_id = p.id AND s.codeq_user_id = %s - GROUP BY l.name) + GROUP BY l.identifier) ) as u ORDER BY u.language, problem_group_id""", (uid, uid,)) #return cur.fetchall() -- cgit v1.2.1