Fix #5: reject_task now uses _system_message for proper WS broadcast
Some checks failed
Deploy Tracker / deploy (push) Failing after 4s
Some checks failed
Deploy Tracker / deploy (push) Failing after 4s
This commit is contained in:
parent
05b56dbdae
commit
901f54f790
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user