forked from gergely/calendar-social
Connect events with profiles instead of local users
This commit is contained in:
@@ -199,12 +199,13 @@ class GregorianCalendar(CalendarSystem):
|
||||
"""Returns all events for a given day
|
||||
"""
|
||||
|
||||
from ..models import Event
|
||||
from ..models import Event, Profile
|
||||
|
||||
events = Event.query
|
||||
|
||||
if user:
|
||||
events = events.filter(Event.user == user)
|
||||
events = events.join(Profile) \
|
||||
.filter(Profile.user == user)
|
||||
|
||||
start_timestamp = date.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
end_timestamp = start_timestamp + timedelta(days=1)
|
||||
|
Reference in New Issue
Block a user