mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: canvas list with team. (#10549)
### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -143,15 +143,12 @@ class UserCanvasService(CommonService):
|
|||||||
]
|
]
|
||||||
if keywords:
|
if keywords:
|
||||||
agents = cls.model.select(*fields).join(User, on=(cls.model.user_id == User.id)).where(
|
agents = cls.model.select(*fields).join(User, on=(cls.model.user_id == User.id)).where(
|
||||||
cls.model.user_id.in_(joined_tenant_ids),
|
(((cls.model.user_id.in_(joined_tenant_ids)) & (cls.model.permission == TenantPermission.TEAM.value)) | (cls.model.user_id == user_id)),
|
||||||
fn.LOWER(cls.model.title).contains(keywords.lower())
|
(fn.LOWER(cls.model.title).contains(keywords.lower()))
|
||||||
#(((cls.model.user_id.in_(joined_tenant_ids)) & (cls.model.permission == TenantPermission.TEAM.value)) | (cls.model.user_id == user_id)),
|
|
||||||
#(fn.LOWER(cls.model.title).contains(keywords.lower()))
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
agents = cls.model.select(*fields).join(User, on=(cls.model.user_id == User.id)).where(
|
agents = cls.model.select(*fields).join(User, on=(cls.model.user_id == User.id)).where(
|
||||||
cls.model.user_id.in_(joined_tenant_ids)
|
(((cls.model.user_id.in_(joined_tenant_ids)) & (cls.model.permission == TenantPermission.TEAM.value)) | (cls.model.user_id == user_id))
|
||||||
#(((cls.model.user_id.in_(joined_tenant_ids)) & (cls.model.permission == TenantPermission.TEAM.value)) | (cls.model.user_id == user_id))
|
|
||||||
)
|
)
|
||||||
if canvas_category:
|
if canvas_category:
|
||||||
agents = agents.where(cls.model.canvas_category == canvas_category)
|
agents = agents.where(cls.model.canvas_category == canvas_category)
|
||||||
|
|||||||
@ -733,7 +733,7 @@ async def run_toc_from_text(chunks, chat_mdl, callback=None):
|
|||||||
max_len = 12 if prune else 22
|
max_len = 12 if prune else 22
|
||||||
filtered = []
|
filtered = []
|
||||||
for x in titles:
|
for x in titles:
|
||||||
if not x.get("title") or x["title"] == "-1":
|
if not isinstance(x, dict) or not x.get("title") or x["title"] == "-1":
|
||||||
continue
|
continue
|
||||||
if len(rag_tokenizer.tokenize(x["title"]).split(" ")) > max_len:
|
if len(rag_tokenizer.tokenize(x["title"]).split(" ")) > max_len:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user