From cdbca938f0102496e5b293596a537ac9cd45d08f Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Tue, 14 May 2024 16:20:37 +0200 Subject: [PATCH] fix: remove eta warnings for active measures --- backend/core/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/core/models.py b/backend/core/models.py index 73ff08b8e..a79b17fa2 100644 --- a/backend/core/models.py +++ b/backend/core/models.py @@ -938,7 +938,7 @@ def quality_check(self) -> dict: measures[i]["id"] = json.loads(_measures)[i]["pk"] for mtg in measures: - if not mtg["eta"]: + if not mtg["eta"] and not mtg["status"] == "active": warnings_lst.append( { "msg": _("{} does not have an ETA").format(mtg["name"]), @@ -946,7 +946,7 @@ def quality_check(self) -> dict: "object": {"name": mtg["name"], "id": mtg["id"]}, } ) - else: + elif mtg["eta"] and not mtg["status"] == "active": if date.today() > datetime.strptime(mtg["eta"], "%Y-%m-%d").date(): errors_lst.append( {