formatting

This commit is contained in:
sadnub
2021-09-05 11:35:15 -04:00
parent 181891757e
commit b20834929c

View File

@@ -198,7 +198,11 @@ class AutomatedTask(BaseAuditModel):
def create_policy_task(self, agent=None, policy=None, assigned_check=None):
# added to allow new policy tasks to be assigned to check only when the agent check exists already
if (self.assigned_check and agent and agent.agentchecks.filter(parent_check=self.assigned_check.id).exists()):
if (
self.assigned_check
and agent
and agent.agentchecks.filter(parent_check=self.assigned_check.id).exists()
):
assigned_check = agent.agentchecks.get(parent_check=self.assigned_check.id)
# if policy is present, then this task is being copied to another policy