fix(checkin): avoid duplicate calendar events at window boundaries

This commit is contained in:
red person
2026-10-26 12:00:12 +03:00
parent 9d0d3720f4
commit 94dc74e500
2 changed files with 45 additions and 4 deletions
+2 -2
View File
@@ -297,7 +297,7 @@ def _digest_windows(now):
def _checkin_calendar_events(db, owner, start, end):
"""Calendar events in [start, end] for ONE owner, for the check-in digest.
"""Calendar events in [start, end) for ONE owner, for the check-in digest.
Ownership lives on CalendarCal.owner; events inherit it via calendar_id.
The digest query had no owner scope, so it pulled EVERY user's events into
@@ -311,7 +311,7 @@ def _checkin_calendar_events(db, owner, start, end):
.filter(
_CC.owner == owner,
_CE.dtstart >= start,
_CE.dtstart <= end,
_CE.dtstart < end,
_CE.status != "cancelled",
)
.order_by(_CE.dtstart)