Skip to content

fix: Fix the parameter issue of the str.format(...) method#5119

Merged
liuruibin merged 3 commits into1Panel-dev:v2from
wangliang181230:PR/fix-problem-3
Apr 16, 2026
Merged

fix: Fix the parameter issue of the str.format(...) method#5119
liuruibin merged 3 commits into1Panel-dev:v2from
wangliang181230:PR/fix-problem-3

Conversation

@wangliang181230
Copy link
Copy Markdown
Contributor

What this PR does / why we need it?

fix: Fix the parameter issue of the str.format(...) method

Summary of your change

修复 str.format(...) 方法的参数问题

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Apr 16, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

**kwargs):
chat_model = get_model_instance_by_model_workspace_id(model_id, workspace_id,
**model_params_setting) if model_id is not None else None
**(model_params_setting or {})) if model_id is not None else None
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

避免报空

self.workflow_manage.params.get('knowledge_base') or {})
maxkb_logger.error(_('data source web node:{node_id} error{error}{traceback}').format(
knowledge_id=node_id, error=str(e), traceback=traceback.format_exc()))
node_id=node_id, error=str(e), traceback=traceback.format_exc()))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数名错误,正确的是 node_id

if node.properties.get('status', 200) != 200:
raise ValidationError(
ErrorDetail(_("Node {node} is unavailable").format(node.properties.get("stepName"))))
ErrorDetail(_("Node {node} is unavailable").format(node=node.properties.get("stepName"))))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

未指定参数名 node

except Exception as e:
maxkb_logger.error(
_('Vectorized knowledge: {knowledge_id} error {error} {traceback}'.format(knowledge_id=knowledge_id,
_('Vectorized knowledge: {knowledge_id} error {error} {traceback}').format(knowledge_id=knowledge_id,
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format方法,在 _(...) 方法内部使用了,会导致多语言失效。

@liuruibin liuruibin merged commit dd9761a into 1Panel-dev:v2 Apr 16, 2026
1 of 2 checks passed
@wangliang181230 wangliang181230 deleted the PR/fix-problem-3 branch April 16, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants