Code

Ticket #4720: syndication-500.diff

File syndication-500.diff, 1020 bytes (added by Bill Fenner <fenner@…>, 7 years ago)
Line 
1Index: contrib/syndication/feeds.py
2===================================================================
3--- contrib/syndication/feeds.py        (revision 5492)
4+++ contrib/syndication/feeds.py        (working copy)
5@@ -51,18 +51,18 @@
6                 return attr()
7         return attr
8 
9-    def get_feed(self, url=None):
10+    def get_object(self, bits):
11+       return None
12+
13+    def get_feed(self, url=""):
14         """
15         Returns a feedgenerator.DefaultFeed object, fully populated, for
16         this feed. Raises FeedDoesNotExist for invalid parameters.
17         """
18-        if url:
19-            try:
20-                obj = self.get_object(url.split('/'))
21-            except (AttributeError, ObjectDoesNotExist):
22-                raise FeedDoesNotExist
23-        else:
24-            obj = None
25+       try:
26+           obj = self.get_object(url.split('/'))
27+       except (AttributeError, ObjectDoesNotExist):
28+           raise FeedDoesNotExist
29 
30         current_site = Site.objects.get_current()
31         link = self.__get_dynamic_attr('link', obj)