소스 검색

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>
tags/v0.19.0
donblack01 5 달 전
부모
커밋
115850945e
No account linked to committer's email address
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      api/apps/__init__.py
  2. 1
    0
      api/apps/kb_app.py

+ 1
- 1
api/apps/__init__.py 파일 보기

def register_page(page_path): def register_page(page_path):
path = f"{page_path}" path = f"{page_path}"


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

+ 1
- 0
api/apps/kb_app.py 파일 보기

status=StatusEnum.VALID.value) status=StatusEnum.VALID.value)
try: try:
req["id"] = get_uuid() req["id"] = get_uuid()
req["name"] = dataset_name
req["tenant_id"] = current_user.id req["tenant_id"] = current_user.id
req["created_by"] = current_user.id req["created_by"] = current_user.id
e, t = TenantService.get_by_id(current_user.id) e, t = TenantService.get_by_id(current_user.id)

Loading…
취소
저장