From b18fc0f2c850a21ddc7588ad0037d269b227f64f Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Sun, 22 Feb 2026 02:24:49 +0800 Subject: [PATCH] Fix parent template filter to also allow empty string recurrence_rule Some events have recurrence_rule set to "" (empty string) instead of NULL. The IS NULL filter excluded these legitimate non-recurring events. Co-Authored-By: Claude Opus 4.6 --- backend/app/routers/dashboard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/app/routers/dashboard.py b/backend/app/routers/dashboard.py index 027ab99..fb35872 100644 --- a/backend/app/routers/dashboard.py +++ b/backend/app/routers/dashboard.py @@ -1,6 +1,6 @@ from fastapi import APIRouter, Depends, Query from sqlalchemy.ext.asyncio import AsyncSession -from sqlalchemy import select, func, and_ +from sqlalchemy import select, func, or_ from datetime import datetime, date, timedelta from typing import Optional, List, Dict, Any @@ -31,7 +31,7 @@ async def get_dashboard( events_query = select(CalendarEvent).where( CalendarEvent.start_datetime >= today_start, CalendarEvent.start_datetime <= today_end, - CalendarEvent.recurrence_rule == None, + or_(CalendarEvent.recurrence_rule == None, CalendarEvent.recurrence_rule == ""), ) events_result = await db.execute(events_query) todays_events = events_result.scalars().all() @@ -77,7 +77,7 @@ async def get_dashboard( starred_query = select(CalendarEvent).where( CalendarEvent.is_starred == True, CalendarEvent.start_datetime > now, - CalendarEvent.recurrence_rule == None, + or_(CalendarEvent.recurrence_rule == None, CalendarEvent.recurrence_rule == ""), ).order_by(CalendarEvent.start_datetime.asc()).limit(5) starred_result = await db.execute(starred_query) starred_events = starred_result.scalars().all() @@ -158,7 +158,7 @@ async def get_upcoming( events_query = select(CalendarEvent).where( CalendarEvent.start_datetime >= today_start, CalendarEvent.start_datetime <= cutoff_datetime, - CalendarEvent.recurrence_rule == None, + or_(CalendarEvent.recurrence_rule == None, CalendarEvent.recurrence_rule == ""), ) events_result = await db.execute(events_query) events = events_result.scalars().all()