发布(0.4.1): 优化分配性能与客服数据边界
修复分配页皮肤查询并发慢查询;客服导入账号严格限制为本人名下;分配概览改用真实归属数量;标题区展示版本并提示刷新。
This commit is contained in:
@@ -10,6 +10,8 @@ from web.backend.models import Account, DouyuTask, DouyuWorkbenchAccount, User
|
||||
from web.backend.routers.douyu import (
|
||||
_split_task_scope_query,
|
||||
_visible_tasks_query,
|
||||
list_task_account_ids,
|
||||
list_task_accounts,
|
||||
list_tasks,
|
||||
)
|
||||
from web.backend.services.douyu_service import (
|
||||
@@ -372,6 +374,38 @@ def test_workbench_task_list_is_limited_to_selected_accounts(db):
|
||||
}
|
||||
|
||||
|
||||
def test_support_with_view_all_permission_still_only_sees_own_import_pool(db):
|
||||
support, _, _, _, tasks = _seed_tasks(db)
|
||||
support.custom_permissions = [
|
||||
"douyu:task",
|
||||
"account:view_assigned",
|
||||
"account:view_all",
|
||||
]
|
||||
db.commit()
|
||||
|
||||
expected_account_id = tasks["assigned_elite"].account_id
|
||||
rows = list_task_accounts(
|
||||
search="",
|
||||
tag="",
|
||||
ids="",
|
||||
account_names="",
|
||||
page=None,
|
||||
page_size=100,
|
||||
db=db,
|
||||
current=support,
|
||||
)
|
||||
ids = list_task_account_ids(
|
||||
search="",
|
||||
tag="",
|
||||
account_names="",
|
||||
db=db,
|
||||
current=support,
|
||||
)
|
||||
|
||||
assert [row.id for row in rows] == [expected_account_id]
|
||||
assert ids["account_ids"] == [expected_account_id]
|
||||
|
||||
|
||||
def test_empty_support_task_list_stays_empty(db):
|
||||
support = User(
|
||||
username="empty-task-support",
|
||||
|
||||
Reference in New Issue
Block a user