Skip to content

Commit

Permalink
Fix link
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Oct 5, 2023
1 parent b08c389 commit 156c243
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 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 @@ -86,16 +86,18 @@ def get_calendars(request, user_access_level: int):
if profile.google_calendar_id:
calendars.append(
{
"name": "personal",
"name": "personal (gcal)",
"link": get_calendar_link(calendar_id=profile.google_calendar_id),
}
)

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

Expand Down
3 changes: 3 additions & 0 deletions hknweb/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = "https://www.ocf.berkeley.edu/~hkn/hknweb/static/"
STATIC_ROOT = "/home/h/hk/hkn/public_html/hknweb/static/"

USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")

0 comments on commit 156c243

Please sign in to comment.