Fix #5: reject_task now uses _system_message for proper WS broadcast
Some checks failed
Deploy Tracker / deploy (push) Failing after 4s

This commit is contained in:
markov 2026-02-26 15:13:00 +01:00
parent 05b56dbdae
commit 901f54f790

View File

@ -459,19 +459,20 @@ async def reject_task(
task.assignee_id = None
task.status = TaskStatus.BACKLOG
old_status = task.status
await _record_action(db, task, current_member, TaskActionType.UNASSIGNED,
"assignee_id", str(old_assignee_id) if old_assignee_id else None, None)
await _record_action(db, task, current_member, TaskActionType.STATUS_CHANGED,
"status", task.status, TaskStatus.BACKLOG)
"status", old_status, TaskStatus.BACKLOG)
comment = Message(
task_id=task.id,
author_type=AuthorType.SYSTEM,
author_id=None,
content=f"Задача отклонена: {req.reason}",
mentions=[],
proj_slug = task.project.slug if task.project else ""
key = f"{proj_slug[:2].upper()}-{task.number}"
await _system_message(
db, task,
chat_text=f"{key}: отклонена @{current_member.slug}{req.reason}",
task_text=f"@{current_member.slug} отклонил задачу: {req.reason}",
project_slug=proj_slug, actor=current_member,
)
db.add(comment)
await db.commit()
from ..ws.manager import manager