Skip to content

Commit

Permalink
Fix event urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Merlin Buczek committed Sep 12, 2019
1 parent a9bd129 commit eaffaf2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mpicms/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime

from django.db import models
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _

Expand Down Expand Up @@ -128,6 +129,7 @@ def clean(self): # Prevent more than one event index

@property
def ics(self):
site = Site.objects.get_current()
c = Calendar()
for event in self.events:
print(event.url)
Expand All @@ -136,7 +138,7 @@ def ics(self):
begin = event.start,
end = event.end,
description = event.search_description,
url = event.url,
url = 'https://' + site.domain + event.url,
location = event.room
)
c.events.add(e)
Expand Down

0 comments on commit eaffaf2

Please sign in to comment.