Browse Source

fix: redis session issue

Timothy Jaeryang Baek 1 month ago
parent
commit
279e3e970f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      backend/open_webui/socket/main.py

+ 4 - 2
backend/open_webui/socket/main.py

@@ -266,7 +266,9 @@ async def connect(sid, environ, auth):
             user = Users.get_user_by_id(data["id"])
 
         if user:
-            SESSION_POOL[sid] = user.model_dump()
+            SESSION_POOL[sid] = user.model_dump(
+                exclude=["date_of_birth", "bio", "gender"]
+            )
             if user.id in USER_POOL:
                 USER_POOL[user.id] = USER_POOL[user.id] + [sid]
             else:
@@ -288,7 +290,7 @@ async def user_join(sid, data):
     if not user:
         return
 
-    SESSION_POOL[sid] = user.model_dump()
+    SESSION_POOL[sid] = user.model_dump(exclude=["date_of_birth", "bio", "gender"])
     if user.id in USER_POOL:
         USER_POOL[user.id] = USER_POOL[user.id] + [sid]
     else: