Skip to content

Commit a0d5b17

Browse files
shaohuzhang1liuruibin
authored andcommitted
fix: Manually adding file types to the workflow knowledge base cannot upload files after adding them in lowercase letters (#4499)
1 parent 1e8459c commit a0d5b17

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

apps/application/flow/knowledge_workflow_manage.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ def hand_node_result(self, current_node, node_result_future):
9595
self.status = 500
9696
current_node.get_write_error_context(e)
9797
self.answer += str(e)
98-
QuerySet(KnowledgeAction).filter(id=self.params.get('knowledge_action_id')).update(
99-
details=self.get_runtime_details(),
100-
state=State.FAILURE)
98+
QuerySet(KnowledgeAction).filter(id=self.params.get('knowledge_action_id')).update(state=State.FAILURE)
10199
finally:
102100
current_node.node_chunk.end()
103101
QuerySet(KnowledgeAction).filter(id=self.params.get('knowledge_action_id')).update(

apps/common/encoder/encoder.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515

1616

1717
class SystemEncoder(json.JSONEncoder):
18+
def encode(self, obj):
19+
# 先序列化为字符串
20+
json_str = super().encode(obj)
21+
# 移除所有空字符
22+
json_str = json_str.replace('\\u0000', '')
23+
return json_str
24+
1825
def default(self, obj):
1926
if isinstance(obj, uuid.UUID):
2027
return str(obj)

0 commit comments

Comments
 (0)