From abc69000b33b4894fbd97fc2c962139cf9a8d784 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 19 Aug 2026 20:16:00 +0200 Subject: [PATCH] fix: treat a non-numeric calendar alert_minutes as unset (#28790) A calendar event's `meta` is a free-form dict, so `meta.alert_minutes` can hold any JSON type, while the upcoming-events lookup assumed it was a number and compared it directly. It now ignores a value that is not numeric and falls back to the default alert window for that event. Handled on the read side rather than on the write path so events already stored with a non-numeric value are covered too. Numeric values are untouched, including the negative "no alert" sentinel. --- backend/open_webui/models/calendar.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/models/calendar.py b/backend/open_webui/models/calendar.py index efdfd291ba..52470f1178 100644 --- a/backend/open_webui/models/calendar.py +++ b/backend/open_webui/models/calendar.py @@ -734,10 +734,10 @@ class CalendarEventTable: events = [] for event, tz in rows: model = CalendarEventModel.model_validate(event) - # Determine per-event alert window - alert_minutes = None - if model.meta and 'alert_minutes' in model.meta: - alert_minutes = model.meta['alert_minutes'] + # meta is user-writable and this poll is shared by every user. + alert_minutes = (model.meta or {}).get('alert_minutes') + if not isinstance(alert_minutes, (int, float)): + alert_minutes = None if alert_minutes is not None: if alert_minutes < 0: