You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@warble.apache.org by hu...@apache.org on 2018/06/25 14:36:51 UTC
[incubator-warble-server] branch master updated: copy from row
factory instead of referencing
This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-warble-server.git
The following commit(s) were added to refs/heads/master by this push:
new 523f9b4 copy from row factory instead of referencing
523f9b4 is described below
commit 523f9b4a8a7012fefed1c1605009ea613518c91e
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Jun 25 09:36:40 2018 -0500
copy from row factory instead of referencing
we need to make the dict malleable, so we'll copy over the key/value
pairs instead of referencing the row factory.
---
api/plugins/session.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/api/plugins/session.py b/api/plugins/session.py
index ce2a2eb..bb3a406 100644
--- a/api/plugins/session.py
+++ b/api/plugins/session.py
@@ -110,8 +110,8 @@ class WarbleSession(object):
sdoc['timestamp'] = int(time.time()) # Update timestamp in session DB
sc.execute("UPDATE `sessions` SET `timestamp` = ? WHERE `cookie` = ? LIMIT 1", (sdoc['timestamp'], cookie,))
if doc:
- self.user = doc
- self.user['userlevel'] = 'superuser'if doc['superuser'] else 'normal'
+ self.user = {k:doc[k] for k in doc.keys()}
+ self.user['userlevel'] = 'superuser' if doc['superuser'] else 'normal'
session_conn.commit()
session_conn.close()
account_conn.close()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@warble.apache.org
For additional commands, e-mail: commits-help@warble.apache.org