From cc3148c94a93eff046a0a7f03def652a929abfd4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 29 Mar 2011 15:55:49 +0200 Subject: Correct the RSS feed to manage empty category (2) --- chimere/rss/feeds.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chimere/rss/feeds.py b/chimere/rss/feeds.py index 0094a60..18a4259 100644 --- a/chimere/rss/feeds.py +++ b/chimere/rss/feeds.py @@ -36,8 +36,8 @@ class BaseFeed(Feed): ''' Return POI permalink ''' coord = item.point cat = 0 - if item.categories.all(): - cat = item.categories.all()[0] + if item.categories.all() and item.categories.all()[0]: + cat = item.categories.all()[0].pk return settings.BASE_URL + '?zoom=16&lat=%d&lon=%d¤t_feature=%d&\ checked_categories=%d' % (coord.y, coord.x, item.id, cat) -- cgit v1.2.3