Skip to content

Commit 1158509

Browse files
donblack01asdfghKevinHuSh
authored
Fix:When you create a new API module named xxxa_api, the access route will become xxx instead of xxxa. For example, when I create a new API module named 'data_api', the access route will become 'dat' instead of 'data (#7325)
### What problem does this PR solve? Fix:When you create a new API module named xxxa_api, the access route will become xxx instead of xxxa. For example, when I create a new API module named 'data_api', the access route will become 'dat' instead of 'data' Fix:Fixed the issue where the new knowledge base would not be renamed when there was a knowledge base with the same name ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: tangyu <1@1.com> Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
1 parent 8e87436 commit 1158509

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

api/apps/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def search_pages_path(pages_dir):
107107
def register_page(page_path):
108108
path = f"{page_path}"
109109

110-
page_name = page_path.stem.rstrip("_app")
110+
page_name = page_path.stem.removesuffix("_app")
111111
module_name = ".".join(
112112
page_path.parts[page_path.parts.index("api"): -1] + (page_name,)
113113
)

api/apps/kb_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def create():
5858
status=StatusEnum.VALID.value)
5959
try:
6060
req["id"] = get_uuid()
61+
req["name"] = dataset_name
6162
req["tenant_id"] = current_user.id
6263
req["created_by"] = current_user.id
6364
e, t = TenantService.get_by_id(current_user.id)

0 commit comments

Comments
 (0)