summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-10-13 12:04:02 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-10-13 12:04:02 +0200
commita48947585eaca16dd64ae534d928698f88ee6150 (patch)
tree169c80f03a8d942cfa1a3a0523201f8ff2424642 /server
parentaf8a603bd4821ee1228df92b28fd169ea2eee4e0 (diff)
Store robot's address in settings
Diffstat (limited to 'server')
-rw-r--r--server/user_session.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/user_session.py b/server/user_session.py
index 9338c2c..9d8a675 100644
--- a/server/user_session.py
+++ b/server/user_session.py
@@ -66,7 +66,7 @@ class UserSession(object):
try:
cur = conn.cursor()
try:
- cur.execute('select id, password, name, email, date_joined, gui_lang from codeq_user where username = %s', (username,))
+ cur.execute('select id, password, name, email, date_joined, gui_lang, robot_address from codeq_user where username = %s', (username,))
row = cur.fetchone()
if row is None:
raise AuthenticationFailed('No such user: {}'.format(username))
@@ -74,7 +74,7 @@ class UserSession(object):
cur.execute('update codeq_user set last_login = %s where id = %s', (str(now), row[0],))
self.uid = row[0]
self.username = username
- self.settings = {'gui_lang': row[5]}
+ self.settings = {'gui_lang': row[5], 'robot_address': row[6]}
return row[2], row[3], row[4], now
else:
raise AuthenticationFailed('Password mismatch')
@@ -142,7 +142,7 @@ class UserSession(object):
try:
cur = conn.cursor()
try:
- cur.execute("update codeq_user set gui_lang = %s where id = %s", (self.settings['gui_lang'], self.uid))
+ cur.execute("update codeq_user set gui_lang = %s, robot_address = %s where id = %s", (self.settings['gui_lang'], self.settings['robot_address'], self.uid))
finally:
cur.close()
finally: