diff options
author | Alban Gruin | 2017-11-01 15:20:55 +0100 |
---|---|---|
committer | Alban Gruin | 2017-11-01 15:20:55 +0100 |
commit | 2d68777e50e261cb793186321947b677ed9de692 (patch) | |
tree | f0ff34041d5eaf7606c372d370dfbd13f3cae4e1 /feeds.py | |
parent | 912f3cca24da9d870aa191348fef901adcd55b7d (diff) |
Correction des crashes provoqués lors de la génération des ICS
lorsque le type d’un cours est nul.
Diffstat (limited to 'feeds.py')
-rw-r--r-- | feeds.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -75,6 +75,11 @@ class IcalFeed(Feed): def item_link(self, item): return "" + def item_summary(self, item): + if item.type is not None: + return item.name + " (" + item.type + ")" + return item.name + def items(self, obj): return Course.objects.get_courses_for_group(obj) @@ -83,7 +88,7 @@ class IcalFeed(Feed): "dtstart": item.begin, "dtend": item.end, "dtstamp": item.last_update, - "summary": item.name + " (" + item.type + ")", + "summary": self.item_summary(item), "location": format_rooms(item.rooms.all())} |