#29296: admindocs crash if a Feed is configured
               Reporter:  Paul Donohue   |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  Uncategorized  |        Version:  2.0
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
 If a Feed (https://docs.djangoproject.com/en/2.0/ref/contrib/syndication/)
 is configured anywhere in the project, then /admin/doc/views/
 crashes with AttributeError: `'GlobalFeed' object has no attribute

 The problem is that Feed is a callable object
 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

 In Django 1.11 and earlier, admindocs supported callable objects on Python
 2 by falling back to `view.__class__.__name__`, but it appears that the
 Python 3 code in admindocs has never supported this.

 As a work-around, `__qualname__` can be manually defined on Feed objects:

 class MyFeed(Feed):
     def __init__(self):
         self.__qualname__ = '__call__'

 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

Ticket URL: <https://code.djangoproject.com/ticket/29296>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to