From ce56afbdf9921108f22c66f958861bcabe05e43b Mon Sep 17 00:00:00 2001 From: sadnub Date: Thu, 23 Sep 2021 11:02:45 -0400 Subject: [PATCH] Fix serialization error in view Also moved policy processing to celery task --- api/tacticalrmm/checks/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/tacticalrmm/checks/views.py b/api/tacticalrmm/checks/views.py index 7d8c3d61..da9c0ecf 100644 --- a/api/tacticalrmm/checks/views.py +++ b/api/tacticalrmm/checks/views.py @@ -137,11 +137,11 @@ class GetUpdateDeleteCheck(APIView): # Re-evaluate agent checks is policy was enforced if check.policy.enforced: - generate_agent_checks_task.delay(policy=check.policy) + generate_agent_checks_task.delay(policy=check.policy.pk) # Agent check deleted elif check.agent: - check.agent.generate_checks_from_policies() + generate_agent_checks_task.delay(agents=[check.agent.pk]) return Response(f"{check.readable_desc} was deleted!")