From aafa613f7a416a685efa41236766f66bdd4268ae Mon Sep 17 00:00:00 2001 From: jain-naman-sf Date: Fri, 13 Oct 2023 10:54:55 +0530 Subject: [PATCH] Fixed Preflight api to return valid results --- metadeploy/api/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadeploy/api/models.py b/metadeploy/api/models.py index 26ae5dd1f2..60e0fcf043 100644 --- a/metadeploy/api/models.py +++ b/metadeploy/api/models.py @@ -862,7 +862,7 @@ def run(self, ctx, plan, steps, org): class PreflightResultQuerySet(models.QuerySet): def most_recent(self, *, org_id, plan, is_valid_and_complete=True): - kwargs = {"org_id": org_id, "plan": plan} + kwargs = {"org_id": org_id, "plan": plan, "is_valid": True} if is_valid_and_complete: kwargs.update({"is_valid": True, "status": PreflightResult.Status.complete}) return self.filter(**kwargs).order_by("-created_at").first()