From 595252c6093464d5bfe4d503543a0e7ed62c1305 Mon Sep 17 00:00:00 2001 From: A R R R Associates Date: Thu, 24 Sep 2026 12:45:00 +0530 Subject: [PATCH] Fix partner task execution context and installer verification --- app/modules/partner_dashboard/service.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/modules/partner_dashboard/service.py b/app/modules/partner_dashboard/service.py index 975fd29..f3eab07 100644 --- a/app/modules/partner_dashboard/service.py +++ b/app/modules/partner_dashboard/service.py @@ -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,