diff --git a/bp/calendar_entry/services/post_associations.py b/bp/calendar_entry/services/post_associations.py index 0d60b2d..8796b73 100644 --- a/bp/calendar_entry/services/post_associations.py +++ b/bp/calendar_entry/services/post_associations.py @@ -97,7 +97,7 @@ async def get_entry_posts( """ result = await session.execute( select(Post) - .join(CalendarEntryPost) + .join(CalendarEntryPost, (CalendarEntryPost.content_id == Post.id) & (CalendarEntryPost.content_type == "post")) .where( CalendarEntryPost.entry_id == entry_id, CalendarEntryPost.deleted_at.is_(None)