summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-18 15:40:27 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-03-18 15:40:27 +0000
commitf0dec08c3a40434310cfbe0748eb9587c7279500 (patch)
tree943157d0c1302ae3b88fddaac24714e636ef7cb8 /django
parent9b52f35f35d67d6b4db2206d34320545dc4dd17d (diff)
Added more robust processing to parameterised syndication feeds for the case
when all the "extra" URL bits are accidentally omitted. Patch from Niran Babalola <niran@niran.org>. Fixed #5855. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7295 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/contrib/syndication/feeds.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/django/contrib/syndication/feeds.py b/django/contrib/syndication/feeds.py
index 45b97d970a..3b2dd60aa0 100644
--- a/django/contrib/syndication/feeds.py
+++ b/django/contrib/syndication/feeds.py
@@ -55,18 +55,23 @@ class Feed(object):
return attr()
return attr
+ def get_object(self, bits):
+ return None
+
def get_feed(self, url=None):
"""
Returns a feedgenerator.DefaultFeed object, fully populated, for
this feed. Raises FeedDoesNotExist for invalid parameters.
"""
if url:
- try:
- obj = self.get_object(url.split('/'))
- except (AttributeError, ObjectDoesNotExist):
- raise FeedDoesNotExist
+ bits = url.split('/')
else:
- obj = None
+ bits = []
+
+ try:
+ obj = self.get_object(bits)
+ except ObjectDoesNotExist:
+ raise FeedDoesNotExist
if Site._meta.installed:
current_site = Site.objects.get_current()