瀏覽代碼

fixed: duplicate name (#1202)

### What problem does this PR solve?

Duplicate method name.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.8.0
cecilia-uu 1 年之前
父節點
當前提交
8d667d5abd
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 2 行新增3 行删除
  1. 1
    1
      api/apps/dataset_api.py
  2. 1
    2
      api/db/services/knowledgebase_service.py

+ 1
- 1
api/apps/dataset_api.py 查看文件

desc = request.args.get("desc", True) desc = request.args.get("desc", True)
try: try:
tenants = TenantService.get_joined_tenants_by_user_id(current_user.id) tenants = TenantService.get_joined_tenants_by_user_id(current_user.id)
kbs = KnowledgebaseService.get_by_tenant_ids(
kbs = KnowledgebaseService.get_by_tenant_ids_by_offset(
[m["tenant_id"] for m in tenants], current_user.id, int(offset), int(count), orderby, desc) [m["tenant_id"] for m in tenants], current_user.id, int(offset), int(count), orderby, desc)
return construct_json_result(data=kbs, code=RetCode.DATA_ERROR, message=f"attempt to list datasets") return construct_json_result(data=kbs, code=RetCode.DATA_ERROR, message=f"attempt to list datasets")
except Exception as e: except Exception as e:

+ 1
- 2
api/db/services/knowledgebase_service.py 查看文件

@classmethod @classmethod
@DB.connection_context() @DB.connection_context()
def get_by_tenant_ids(cls, joined_tenant_ids, user_id,
offset, count, orderby, desc):
def get_by_tenant_ids_by_offset(cls, joined_tenant_ids, user_id, offset, count, orderby, desc):
kbs = cls.model.select().where( kbs = cls.model.select().where(
((cls.model.tenant_id.in_(joined_tenant_ids) & (cls.model.permission == ((cls.model.tenant_id.in_(joined_tenant_ids) & (cls.model.permission ==
TenantPermission.TEAM.value)) | ( TenantPermission.TEAM.value)) | (

Loading…
取消
儲存