Self hosted FLOSS fitness/workout, nutrition and weight tracker
Use convenience method to load the current site
Roland Geider0eed3ae5aadd
diff --git a/wger/manager/views/ical.py b/wger/manager/views/ical.pyindex 253f00553..2a53d3dfb 100644--- a/wger/manager/views/ical.py+++ b/wger/manager/views/ical.py@@ -24,7 +24,6 @@ from icalendar.tools import UIDGeneratorfrom django.shortcuts import get_object_or_404from django.http import HttpResponse, HttpResponseForbidden-from django.conf import settingsfrom django.contrib.sites.models import Sitefrom wger import get_version@@ -77,7 +76,7 @@ def get_events_workout(calendar, workout, duration, start_date=None):start_date = start_date if start_date else workout.creation_dateend_date = start_date + datetime.timedelta(weeks=duration)generator = UIDGenerator()- site = Site.objects.get(pk=settings.SITE_ID)+ site = Site.objects.get_current()for day in workout.canonical_representation['day_list']: