Fix partner review rework classification
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user