Skip to content

Commit

Permalink
Add warning when opening hour parsing fails
Browse files Browse the repository at this point in the history
  • Loading branch information
redfast00 committed Oct 10, 2024
1 parent d38db87 commit f616f57
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/hlds/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f616f57

Please sign in to comment.