diff options
-rw-r--r-- | server/user_session.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/user_session.py b/server/user_session.py index 7860022..21c3009 100644 --- a/server/user_session.py +++ b/server/user_session.py @@ -67,6 +67,7 @@ class UserSession(object): self.is_admin = False self._lang_session = None self.settings = {} + self.experiments = [] self.last_access = int(time.time()) # resolution: 1 second with module_access_lock: sessions[self.sid] = self @@ -163,12 +164,13 @@ class UserSession(object): try: cur = conn.cursor() try: - cur.execute('update codeq_user set name = coalesce(%s, name), email = coalesce(%s, email), saml_data = %s, last_login = %s where username = %s and password is null returning id, gui_lang, date_joined, robot_address, gui_layout, email', (name, email, psycopg2.extras.Json(saml_data), str(now), eduPersonPrincipalName)) + cur.execute('update codeq_user set name = coalesce(%s, name), email = coalesce(%s, email), saml_data = %s, last_login = %s where username = %s and password is null returning id, gui_lang, date_joined, robot_address, gui_layout, email, experiments', (name, email, psycopg2.extras.Json(saml_data), str(now), eduPersonPrincipalName)) row = cur.fetchone() if row: self.uid = row[0] self.username = eduPersonPrincipalName self.settings = {'gui_lang': row[1], 'robot_address': row[3], 'gui_layout': row[4]} + self.experiments = row[6] if row[6] else [] date_joined = row[2] if email is None: email = row[5] |