aboutsummaryrefslogtreecommitdiff
path: root/feeds.py
diff options
context:
space:
mode:
authorAlban Gruin2017-11-06 08:26:46 +0100
committerAlban Gruin2017-11-06 08:26:46 +0100
commit60b2ceaa43d01e34514f3e68f45585619807d1cf (patch)
treecf8763dfd9bbbe48a5383a5f49ca07437916c7a6 /feeds.py
parent771f4ebb8f1e27212bfce413ea664a73c7a86965 (diff)
parent37a95855076035470e7484804ed48b779ed22277 (diff)
Merge branch 'dev/alban'
Diffstat (limited to 'feeds.py')
-rw-r--r--feeds.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/feeds.py b/feeds.py
index 66be12e..aced5e6 100644
--- a/feeds.py
+++ b/feeds.py
@@ -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())}