summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-04-24 20:50:38 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-04-24 20:50:38 +0200
commit192641bb70eeba3b8d24ad0490a70902f518ff5f (patch)
tree2a04a047bf5d6430e2a086a7d1b3c0e040a6dd7a /server
parent98d4b05fa8a94ce184b3aa7f52d823458ad2edfd (diff)
Return info about experiments to the client
Diffstat (limited to 'server')
-rw-r--r--server/handlers.py5
-rw-r--r--server/user_session.py2
2 files changed, 4 insertions, 3 deletions
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: