summaryrefslogtreecommitdiff
path: root/server/user_session.py
diff options
context:
space:
mode:
Diffstat (limited to 'server/user_session.py')
-rw-r--r--server/user_session.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/user_session.py b/server/user_session.py
index 6d5af47..3035d77 100644
--- a/server/user_session.py
+++ b/server/user_session.py
@@ -57,6 +57,25 @@ class UserSession(object):
def get_settings(self):
return self.settings
+ def update_settings(self, newSettings):
+ #print("new:"+newSettings)
+ self.settings.update(newSettings)
+
+ def write_settings_to_db(self):
+ conn = db.get_connection()
+ try:
+ cur = conn.cursor()
+ try:
+ #cur.execute("UPDATE codeq_user SET gui_lang='"+self.settings.lang+"' WHERE id="+self.uid)
+ #print(self.settings)
+ print("UPDATE codeq_user SET gui_lang='" + self.settings['lang'] + "' WHERE id="+str(self.uid))
+ finally:
+ cur.close()
+ finally:
+ conn.commit()
+ db.return_connection(conn)
+
+
def get_prolog(self):
with self._access_lock:
if self.prolog_session is None: