diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-03-29 15:55:49 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-03-29 15:55:49 +0200 |
commit | cc3148c94a93eff046a0a7f03def652a929abfd4 (patch) | |
tree | 4ae960fe8a13957a59b231e174def1b9ad3bf300 | |
parent | caae30ec3bdd442b3451935a449f797c3ffa1dad (diff) | |
download | Chimère-cc3148c94a93eff046a0a7f03def652a929abfd4.tar.bz2 Chimère-cc3148c94a93eff046a0a7f03def652a929abfd4.zip |
Correct the RSS feed to manage empty category (2)
-rw-r--r-- | chimere/rss/feeds.py | 4 |
1 files 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) |