fix(local_time): also handle time objects safely
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-04-07 08:20:47 +02:00
parent fd7577ff67
commit 180a12de27

3
app.py
View File

@ -230,6 +230,9 @@ def local_time_filter(dt, fmt='%d.%m.%Y %H:%M'):
# date objects (not datetime) — format directly, no timezone conversion # date objects (not datetime) — format directly, no timezone conversion
if not hasattr(dt, 'hour'): if not hasattr(dt, 'hour'):
return dt.strftime(fmt) return dt.strftime(fmt)
# time objects — format directly, no timezone conversion
if not hasattr(dt, 'year'):
return dt.strftime(fmt)
if dt.tzinfo is None: if dt.tzinfo is None:
dt = dt.replace(tzinfo=_UTC_TZ) dt = dt.replace(tzinfo=_UTC_TZ)
return dt.astimezone(_WARSAW_TZ).strftime(fmt) return dt.astimezone(_WARSAW_TZ).strftime(fmt)