Explorar o código

Fix/assistant none type (#2145)

Yeuoly hai 1 ano
pai
achega
27828f44b9
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      api/core/file/message_file_parser.py

+ 3 - 2
api/core/file/message_file_parser.py

@@ -128,8 +128,9 @@ class MessageFileParser:
 
         # group by file type and convert file args or message files to FileObj
         for file in files:
-            if file.belongs_to == FileBelongsTo.ASSISTANT.value:
-                continue
+            if isinstance(file, MessageFile):
+                if file.belongs_to == FileBelongsTo.ASSISTANT.value:
+                    continue
 
             file_obj = self._to_file_obj(file, file_upload_config)
             if file_obj.type not in type_file_objs: