﻿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
29296	admindocs ViewIndexView crashes if a syndication Feed (or something without __qualname__) is configured	Paul Donohue	nobody	"If a Feed (https://docs.djangoproject.com/en/2.0/ref/contrib/syndication/) is configured anywhere in the project, then /admin/doc/views/ (https://docs.djangoproject.com/en/2.0/ref/contrib/admin/admindocs/) crashes with AttributeError: `'GlobalFeed' object has no attribute '__qualname__'`

The problem is that Feed is a callable object (https://github.com/django/django/blob/master/django/contrib/syndication/views.py#L34) and the documentation uses that class directly as a View (`path('latest/feed/', LatestEntriesFeed()),`), but admindocs assumes that all views are functions and it does not work properly with a callable object (https://github.com/django/django/blob/master/django/contrib/admindocs/views.py#L130).

In Django 1.11 and earlier, admindocs supported callable objects on Python 2 because it fell back to `view.__class__.__name__`, but it appears that the Python 3 code in admindocs has not supported this since it was added in https://github.com/django/django/commit/ae0f55eb491255217d6df31296ec8102007224a6 (https://code.djangoproject.com/ticket/27018).

As a work-around, `__qualname__` can be manually defined on Feed objects:

{{{
class MyFeed(Feed):
    def __init__(self):
        super().__init__()
        self.__qualname__ = self.__class__.__name__
}}}

Without knowing Django's opinion of the use of callable objects as views, I don't know the appropriate way to fix this: Should admindocs support callable objects as views, or should Feed not use a callable object as a view?"	Bug	closed	contrib.admindocs	2.0	Normal	fixed			Ready for checkin	1	0	0	0	0	0
