diff options
author | Alban Gruin | 2017-09-24 14:37:09 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-24 15:04:11 +0200 |
commit | 6f026e4f0bca3cc3bb137bc26967283510c135de (patch) | |
tree | 5c0230f86221de5a5be0e3f8ead353fd811dd6cb /feeds.py | |
parent | f6da809651874179c6deb2e008e7a294375d2264 (diff) |
Ajout des propriétés uid et prodid dans les iCalendar
Diffstat (limited to 'feeds.py')
-rw-r--r-- | feeds.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -27,7 +27,7 @@ from .models import Course, Group, LastUpdate from .templatetags.rooms import format_rooms from .utils import get_current_or_next_week, get_week, group_courses -ICAL_NAMES = ["summary", "description", "location", "start", "dtstart", "dtend"] +ICAL_NAMES = ["uid", "summary", "description", "location", "start", "dtstart", "dtend"] class IcalFeedGenerator(SyndicationFeed): @@ -35,6 +35,7 @@ class IcalFeedGenerator(SyndicationFeed): def write(self, outfile, encoding): calendar = Calendar() + calendar.add("prodid", "-//celcatsanitizer//NONSGML v1.0//EN") calendar.add("version", "2.0") self.write_events(calendar) @@ -71,7 +72,8 @@ class IcalFeed(Feed): return Course.objects.get_courses_for_group(obj).order_by("begin") def item_extra_kwargs(self, item): - return {"dtstart": item.begin, + return {"uid": "{0}@celcatsanitizer".format(item.id), + "dtstart": item.begin, "dtend": item.end, "summary": item.name, "location": format_rooms(item.rooms.all())} |