﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
4720	feed class get_object has no opportunity to object to not having a url	Bill Fenner <fenner@…>	cablehead	"I have a feed that looks almost exactly like the ""complex example"" given in the manual for chicagocrime.org:

{{{
class DocumentComments(Feed):
    feed_type = Atom1Feed
    def get_object(self, bits):
        if len(bits) != 1:
            raise InternetDraft.DoesNotExist
        return InternetDraft.objects.get(filename=bits[0])
}}}

I assumed that since that method existed, it would be called for all requests, and a request for the ""base"" url of the feed would result in the DoesNotExist exception.  Instead, I get ""AttributeError: 'NoneType' object has no attribute 'filename'"", since in link() I use `obj.filename` and obj is getting set to None.

I don't like having a known url for a 500 error, since I expect users to try to hack the urls and see what they can see.

I've attached a proposed diff.  It always calls get_object, and creates a default get_object method that returns None.  This should keep the existing behavior (and, in fact, works fine with my other feeds that don't take objects), and allows the user's class to handle a bits=[] if they would like to.

With the existing setup, the only way I can think of to not provide a 500 error when visiting this feed without an additional URL portion is to test for obj == None in the link method, and I can only do that because I know that the link one is the first one called - way too much internal knowledge of the feed class."		closed	contrib.syndication	dev		fixed		cablehead	Ready for checkin	1	0	0	0	0	0
