Skip to content

Commit

Permalink
fix tz bug in calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
depocoder committed Nov 25, 2024
1 parent 9b18599 commit b160780
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/yet_another_calendar/web/api/bulk/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def get_calendar(
"""
Get events from Netology and Modeus, cached.
"""

time_zone: str = "Europe/Moscow" # todo fix after frontend
cached_calendar = await integration.get_cached_calendar(body, lms_user, calendar_id, cookies)
if isinstance(cached_calendar, schema.CalendarResponse):
return cached_calendar.change_timezone(time_zone)
Expand All @@ -47,7 +47,7 @@ async def refresh_calendar(
"""
Refresh events in redis.
"""

time_zone: str = "Europe/Moscow" # todo fix after frontend
return await integration.refresh_events(body, lms_user, jwt_token, calendar_id, cookies, time_zone)


Expand All @@ -63,6 +63,7 @@ async def export_ics(
"""
Export into .ics format
"""
time_zone: str = "Europe/Moscow" # todo fix after frontend
calendar = await integration.get_calendar(body, lms_user, jwt_token, calendar_id, cookies)
calendar_with_timezone = calendar.change_timezone(time_zone)
return StreamingResponse(integration.export_to_ics(calendar_with_timezone))

0 comments on commit b160780

Please sign in to comment.