Fix serialization error in view
Also moved policy processing to celery task
This commit is contained in:
parent
4a702b6813
commit
ce56afbdf9
|
@ -137,11 +137,11 @@ class GetUpdateDeleteCheck(APIView):
|
||||||
|
|
||||||
# Re-evaluate agent checks is policy was enforced
|
# Re-evaluate agent checks is policy was enforced
|
||||||
if check.policy.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
|
# Agent check deleted
|
||||||
elif check.agent:
|
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!")
|
return Response(f"{check.readable_desc} was deleted!")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue