fix: The tool in the application export loop body has not been exported (#4177)
parent
e4ac7783e3
commit
301785bfda
|
|
@ -683,7 +683,10 @@ class ApplicationOperateSerializer(serializers.Serializer):
|
||||||
application = QuerySet(Application).filter(id=application_id).first()
|
application = QuerySet(Application).filter(id=application_id).first()
|
||||||
tool_id_list = [node.get('properties', {}).get('node_data', {}).get('tool_lib_id') for node
|
tool_id_list = [node.get('properties', {}).get('node_data', {}).get('tool_lib_id') for node
|
||||||
in
|
in
|
||||||
application.work_flow.get('nodes', []) if
|
application.work_flow.get('nodes', []) + reduce(lambda x, y: [*x, *y], [
|
||||||
|
n.get('properties', {}).get('node_data', {}).get('loop_body', {}).get('nodes', []) for n
|
||||||
|
in
|
||||||
|
application.work_flow.get('nodes', []) if n.get('type') == 'loop-node'], []) if
|
||||||
node.get('type') == 'tool-lib-node']
|
node.get('type') == 'tool-lib-node']
|
||||||
tool_list = []
|
tool_list = []
|
||||||
if len(tool_id_list) > 0:
|
if len(tool_id_list) > 0:
|
||||||
|
|
@ -760,7 +763,7 @@ class ApplicationOperateSerializer(serializers.Serializer):
|
||||||
work_flow_version.save()
|
work_flow_version.save()
|
||||||
access_token = hashlib.md5(
|
access_token = hashlib.md5(
|
||||||
str(uuid.uuid7()).encode()).hexdigest()[
|
str(uuid.uuid7()).encode()).hexdigest()[
|
||||||
8:24]
|
8:24]
|
||||||
application_access_token = QuerySet(ApplicationAccessToken).filter(
|
application_access_token = QuerySet(ApplicationAccessToken).filter(
|
||||||
application_id=application.id).first()
|
application_id=application.id).first()
|
||||||
if application_access_token is None:
|
if application_access_token is None:
|
||||||
|
|
@ -965,7 +968,8 @@ class ApplicationOperateSerializer(serializers.Serializer):
|
||||||
application = QuerySet(ApplicationVersion).filter(application_id=application_id).order_by(
|
application = QuerySet(ApplicationVersion).filter(application_id=application_id).order_by(
|
||||||
'-create_time').first()
|
'-create_time').first()
|
||||||
if application.stt_model_enable:
|
if application.stt_model_enable:
|
||||||
model = get_model_instance_by_model_workspace_id(application.stt_model_id, application.workspace_id, **application.stt_model_params_setting)
|
model = get_model_instance_by_model_workspace_id(application.stt_model_id, application.workspace_id,
|
||||||
|
**application.stt_model_params_setting)
|
||||||
text = model.speech_to_text(instance.get('file'))
|
text = model.speech_to_text(instance.get('file'))
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue