diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-12-11 15:18:20 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-12-11 16:11:15 +0100 |
commit | dd723bd01634fa5ffc85402ea10947e472b257af (patch) | |
tree | c322b9e267e436dfcb8353f57f4ef1ec2b6f1b11 /server | |
parent | 98c6716874472b981f088bff7a4348e6116fd681 (diff) |
Add is_admin attribute to UserSession
Diffstat (limited to 'server')
-rw-r--r-- | server/user_session.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/server/user_session.py b/server/user_session.py index 900238c..63d3459 100644 --- a/server/user_session.py +++ b/server/user_session.py @@ -64,6 +64,7 @@ class UserSession(object): self.sid = uuid.uuid4().hex self.uid = None self.username = None + self.is_admin = False self._lang_session = None self.settings = {} self.last_access = int(time.time()) # resolution: 1 second @@ -93,6 +94,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.is_admin = row[4] self.settings = {'gui_lang': row[6], 'robot_address': row[7], 'gui_layout': row[8]} return row[2], row[3], row[4], row[5], now else: @@ -219,6 +221,7 @@ class UserSession(object): username = self.username self.uid = None self.username = None + self.is_admin = False self.settings = {} if lang_session is not None: # do not handle the language session holding the lock: we may deadlock if the callee calls the caller lang_session.destroy() |