From f616f5798081068f405cca0ed3ebae57654cacfb Mon Sep 17 00:00:00 2001 From: redfast00 Date: Thu, 10 Oct 2024 18:47:31 +0200 Subject: [PATCH] Add warning when opening hour parsing fails --- app/hlds/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/hlds/models.py b/app/hlds/models.py index aacffef..4f6c706 100644 --- a/app/hlds/models.py +++ b/app/hlds/models.py @@ -4,6 +4,7 @@ from datetime import datetime, timedelta from typing import Any, Iterable, List, Mapping, Optional, Tuple from opening_hours import OpeningHours +import warnings from ..utils import euro_string, first @@ -138,6 +139,7 @@ def is_open(self) -> bool | None: try: return OpeningHours(self.opening_hours).is_open() except SyntaxError: + warnings.warn(f"Opening hour syntax parsing for {self.name} failed") return None def is_open_symbol(self) -> str: