mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Change ical to use dynamically generated URL's instead of a static base URL.
This commit is contained in:
@@ -112,8 +112,8 @@ class CalendarICS(ICalFeed):
|
||||
|
||||
def item_link(self, item):
|
||||
# Make a link to the event in the web interface
|
||||
base_url = "https://pyrigs.nottinghamtec.co.uk"
|
||||
return base_url+str(reverse_lazy('event_detail',kwargs={'pk':item.pk}))
|
||||
# base_url = "https://pyrigs.nottinghamtec.co.uk"
|
||||
return item.get_absolute_url()
|
||||
|
||||
# def item_created(self, item): #TODO - Implement created date-time (using django-reversion?) - not really necessary though
|
||||
# return ''
|
||||
|
||||
@@ -9,6 +9,7 @@ from django.utils.encoding import python_2_unicode_compatible
|
||||
import reversion
|
||||
import string
|
||||
import random
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
@@ -304,6 +305,9 @@ class Event(models.Model, RevisionMixin):
|
||||
|
||||
objects = EventManager()
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse_lazy('event_detail', kwargs={'pk': self.pk})
|
||||
|
||||
def __str__(self):
|
||||
return str(self.pk) + ": " + self.name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user