cecilia-uu
commited on
Commit
·
f5b2546
1
Parent(s):
5a13721
fixed: duplicate name (#1202)
Browse files### What problem does this PR solve?
Duplicate method name.
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
api/apps/dataset_api.py
CHANGED
@@ -125,7 +125,7 @@ def list_datasets():
|
|
125 |
desc = request.args.get("desc", True)
|
126 |
try:
|
127 |
tenants = TenantService.get_joined_tenants_by_user_id(current_user.id)
|
128 |
-
kbs = KnowledgebaseService.
|
129 |
[m["tenant_id"] for m in tenants], current_user.id, int(offset), int(count), orderby, desc)
|
130 |
return construct_json_result(data=kbs, code=RetCode.DATA_ERROR, message=f"attempt to list datasets")
|
131 |
except Exception as e:
|
|
|
125 |
desc = request.args.get("desc", True)
|
126 |
try:
|
127 |
tenants = TenantService.get_joined_tenants_by_user_id(current_user.id)
|
128 |
+
kbs = KnowledgebaseService.get_by_tenant_ids_by_offset(
|
129 |
[m["tenant_id"] for m in tenants], current_user.id, int(offset), int(count), orderby, desc)
|
130 |
return construct_json_result(data=kbs, code=RetCode.DATA_ERROR, message=f"attempt to list datasets")
|
131 |
except Exception as e:
|
api/db/services/knowledgebase_service.py
CHANGED
@@ -42,8 +42,7 @@ class KnowledgebaseService(CommonService):
|
|
42 |
|
43 |
@classmethod
|
44 |
@DB.connection_context()
|
45 |
-
def
|
46 |
-
offset, count, orderby, desc):
|
47 |
kbs = cls.model.select().where(
|
48 |
((cls.model.tenant_id.in_(joined_tenant_ids) & (cls.model.permission ==
|
49 |
TenantPermission.TEAM.value)) | (
|
|
|
42 |
|
43 |
@classmethod
|
44 |
@DB.connection_context()
|
45 |
+
def get_by_tenant_ids_by_offset(cls, joined_tenant_ids, user_id, offset, count, orderby, desc):
|
|
|
46 |
kbs = cls.model.select().where(
|
47 |
((cls.model.tenant_id.in_(joined_tenant_ids) & (cls.model.permission ==
|
48 |
TenantPermission.TEAM.value)) | (
|