Skip to content

Commit

Permalink
fix: remove eta warnings for active measures
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed May 14, 2024
1 parent f052b89 commit cdbca93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,15 +938,15 @@ 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"]),
"obj_type": "appliedcontrol",
"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(
{
Expand Down

0 comments on commit cdbca93

Please sign in to comment.