aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2021-03-26 19:41:25 +0000
committerzsloan2021-03-26 19:41:25 +0000
commit0daaa41adafdfbfed10c0dca27ef5eef008441da (patch)
tree9b295a3df91f0f0ffb32388e2ca2b624f6698e1a
parented863c84162bddcb97e82d96538055cae11d560b (diff)
downloadgenenetwork2-0daaa41adafdfbfed10c0dca27ef5eef008441da.tar.gz
Added try/except to deal with the possibility of user_id being stored in Redis as both string and bytes
-rw-r--r--wqflask/wqflask/user_session.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/wqflask/wqflask/user_session.py b/wqflask/wqflask/user_session.py
index d6f3b3fc..c5a577df 100644
--- a/wqflask/wqflask/user_session.py
+++ b/wqflask/wqflask/user_session.py
@@ -129,7 +129,10 @@ class UserSession(object):
if b'user_id' not in self.record:
self.record[b'user_id'] = str(uuid.uuid4())
- return self.record[b'user_id']
+ try:
+ return self.record[b'user_id'].decode("utf-8")
+ except:
+ return self.record[b'user_id']
@property
def redis_user_id(self):