forked from open-webui/open-webui
		
	fix: share chat permission issue
This commit is contained in:
		
							parent
							
								
									eb5ed905eb
								
							
						
					
					
						commit
						f64ac3269f
					
				
					 2 changed files with 21 additions and 1 deletions
				
			
		|  | @ -206,6 +206,18 @@ class ChatTable: | |||
|         except: | ||||
|             return None | ||||
| 
 | ||||
|     def get_chat_by_share_id(self, id: str) -> Optional[ChatModel]: | ||||
|         try: | ||||
|             chat = Chat.get(Chat.share_id == id) | ||||
| 
 | ||||
|             if chat: | ||||
|                 chat = Chat.get(Chat.id == id) | ||||
|                 return ChatModel(**model_to_dict(chat)) | ||||
|             else: | ||||
|                 return None | ||||
|         except: | ||||
|             return None | ||||
| 
 | ||||
|     def get_chat_by_id_and_user_id(self, id: str, user_id: str) -> Optional[ChatModel]: | ||||
|         try: | ||||
|             chat = Chat.get(Chat.id == id, Chat.user_id == user_id) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek