Skip to content

Commit

Permalink
Fix link again (whoops)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Oct 5, 2023
1 parent d1fca9a commit 22dc106
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hknweb/events/views/aggregate_displays/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, render

from hknweb.events.google_calendar_utils import get_calendar_link
from hknweb.events.google_calendar_utils import SHARE_LINK_TEMPLATE, get_calendar_link
from hknweb.events.models import Event, EventType, GCalAccessLevelMapping, ICalView
from hknweb.events.models.constants import ACCESS_LEVELS
from hknweb.events.utils import get_events
Expand Down Expand Up @@ -92,12 +92,14 @@ def get_calendars(request, user_access_level: int):
)

ical_view, _ = ICalView.objects.get_or_create(user=request.user)
ical_url = request.build_absolute_uri(ical_view.url).replace(
"https://", "webcal://"
)
print(ical_url)
calendars.append(
{
"name": "personal (ics)",
"link": get_calendar_link(
calendar_id=ical_view.url.replace("https://", "webcal://")
),
"link": SHARE_LINK_TEMPLATE.format(cid=ical_url),
}
)

Expand Down

0 comments on commit 22dc106

Please sign in to comment.