Minor tweaks (#10987)

### What problem does this PR solve?

1. Rename identifier name
2. Fix some return statement
3. Fix some typos

### Type of change

- [x] Refactoring

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2025-11-04 14:15:31 +08:00
committed by GitHub
parent 021b2ac51a
commit 16d2be623c
12 changed files with 37 additions and 34 deletions

View File

@ -285,7 +285,7 @@ class KnowledgebaseService(CommonService):
(cls.model.status == StatusEnum.VALID.value)
).dicts()
if not kbs:
return
return None
return kbs[0]
@classmethod
@ -381,7 +381,7 @@ class KnowledgebaseService(CommonService):
"""Create a dataset (knowledgebase) by name with kb_app defaults.
This encapsulates the creation logic used in kb_app.create so other callers
(including RESTful endpoints) can reuse the same behavior.
(including RESTFul endpoints) can reuse the same behavior.
Returns:
(ok: bool, model_or_msg): On success, returns (True, Knowledgebase model instance);