Fix partner task execution context and installer verification

This commit is contained in:
A R R R Associates
2026-09-24 12:45:00 +05:30
parent b176f60c11
commit 595252c609
+8 -4
View File
@@ -193,10 +193,6 @@ def _task_label(task: ClientServiceTaskInstance) -> dict[str, Any]:
catalogue = getattr(task, "catalogue", None)
assignee = getattr(task, "assigned_to", None)
status = (task.status or "pending").replace("_", " ").title()
status_code = (getattr(task, "status", None) or "pending").strip().lower()
is_locked = bool(getattr(task, "is_locked", False) or getattr(subscription, "is_locked", False))
is_task_assignee = int(getattr(task, "assigned_to_user_id", 0) or 0) == int(getattr(current_user, "id", 0) or 0)
can_execute = bool(is_task_assignee and not is_locked and status_code not in {"completed", "not_applicable"})
return {
"id": task.id,
@@ -512,6 +508,14 @@ def _partner_task_payload(task: ClientServiceTaskInstance, subscription: ClientS
comments = [c for c in (getattr(task, "comments", None) or []) if not getattr(c, "is_deleted", False)]
documents = [d for d in (getattr(task, "documents", None) or []) if not getattr(d, "is_deleted", False)]
assignee = getattr(task, "assigned_to", None)
status_code = (getattr(task, "status", None) or "pending").strip().lower()
is_locked = bool(getattr(task, "is_locked", False) or getattr(subscription, "is_locked", False))
is_task_assignee = int(getattr(task, "assigned_to_user_id", 0) or 0) == int(getattr(current_user, "id", 0) or 0)
can_execute = bool(
is_task_assignee
and not is_locked
and status_code not in {"completed", "not_applicable"}
)
return {
"id": task.id,
"task_name": task.task_name,