From 192641bb70eeba3b8d24ad0490a70902f518ff5f Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 24 Apr 2016 20:50:38 +0200 Subject: Return info about experiments to the client --- server/handlers.py | 5 +++-- server/user_session.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'server') diff --git a/server/handlers.py b/server/handlers.py index b59b282..5e06463 100644 --- a/server/handlers.py +++ b/server/handlers.py @@ -55,7 +55,7 @@ class Login(CodeqService): username = js.get('username') password = js.get('password') try: - name, email, is_admin, date_joined, last_login = request.session.login(username, password) + name, email, is_admin, date_joined, last_login, experiments = request.session.login(username, password) except AuthenticationFailed: request.reply({'code': 1, 'message': 'Wrong username or password'}) else: @@ -69,7 +69,8 @@ class Login(CodeqService): 'admin': is_admin, 'joined': date_joined.isoformat(), 'last-login': last_login.isoformat(), - 'settings': settings + 'settings': settings, + 'experiments': experiments, }) diff --git a/server/user_session.py b/server/user_session.py index 21c3009..52b6c9d 100644 --- a/server/user_session.py +++ b/server/user_session.py @@ -98,7 +98,7 @@ class UserSession(object): self.is_admin = row[4] self.settings = {'gui_lang': row[6], 'robot_address': row[7], 'gui_layout': row[8]} self.experiments = row[9] if row[9] else [] - return row[2], row[3], row[4], row[5], now + return row[2], row[3], row[4], row[5], now, self.experiments else: raise AuthenticationFailed('Password mismatch') finally: -- cgit v1.2.1