Fix partner review rework classification

This commit is contained in:
A R R R Associates
2026-08-10 15:52:51 +05:30
parent 09ef7a7a52
commit dea1ea9491
+8 -1
View File
@@ -160,8 +160,15 @@ def _task_bucket(task: ClientServiceTaskInstance) -> str:
return "pending_review"
if status in CLOSED_TASK_STATUSES:
return "completed"
if status in {"pending", "rework", "rework_required"}:
if status in {"rework", "rework_required"}:
return "rework_sent"
if status == "pending":
has_partner_rework = any(
(getattr(comment, "comment_type", "") or "").strip().lower() == "partner_review_note"
and not getattr(comment, "is_deleted", False)
for comment in getattr(task, "comments", [])
)
return "rework_sent" if has_partner_rework else "approved"
return "approved"