aboutsummaryrefslogtreecommitdiff
path: root/feeds.py
diff options
context:
space:
mode:
authorAlban Gruin2017-09-08 11:53:49 +0200
committerAlban Gruin2017-09-08 11:53:49 +0200
commit57ffdbf0658042069abcf0b1f9184ff69a3139e2 (patch)
tree85ab2f0cf55fc85dec62b065b7eb246b7de46e4c /feeds.py
parent0a287c2013bcfd1cb71926fbd0835170369521f7 (diff)
Ajout de l’année dans les urls
Diffstat (limited to 'feeds.py')
-rw-r--r--feeds.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/feeds.py b/feeds.py
index ca1c843..e2b0b3f 100644
--- a/feeds.py
+++ b/feeds.py
@@ -19,7 +19,7 @@ from django.utils.feedgenerator import SyndicationFeed
from icalendar import Calendar, Event
-from .models import Course, Group, Timetable
+from .models import Course, Group, Timetable, Year
from .templatetags.rooms import format_rooms
ICAL_NAMES = ["summary", "description", "location", "start", "dtstart", "dtend"]
@@ -48,9 +48,10 @@ class IcalFeed(Feed):
feed_type = IcalFeedGenerator
link = ""
- def get_object(self, request, timetable_slug, group_slug):
+ def get_object(self, request, year_slug, timetable_slug, group_slug):
try:
- timetable = Timetable.objects.get(slug=timetable_slug)
+ year = Year.objects.get(slug=year_slug)
+ timetable = Timetable.objects.get(year=year, slug=timetable_slug)
group = Group.objects.get(timetable=timetable, slug=group_slug)
except:
raise ObjectDoesNotExist