Code

Opened 6 years ago

Closed 5 years ago

Last modified 3 years ago

#8889 closed (fixed)

admindocs.views.view_index dies when views are callable classes

Reported by: Matthew Flanagan <mattimustang@…> Owned by: nobody
Component: Contrib apps Version: 1.0
Severity: Keywords: admindocs
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I'm using django_restapi and the django.contrib.admindocs Views listing dies with the traceback:

Traceback:
File "/home/mflanaga/src/nong/vendor/django/django/core/handlers/base.py" in get_response
  86.                 response = callback(request, *callback_args, **callback_kwargs)
File "/home/mflanaga/src/nong/vendor/django/django/contrib/admin/views/decorators.py" in _checklogin
  33.             return view_func(request, *args, **kwargs)
File "/home/mflanaga/src/nong/vendor/django/django/contrib/admindocs/views.py" in view_index
  131.                 'name': func.__name__,

Exception Type: AttributeError at /admin/docs/views/
Exception Value: 'Collection' object has no attribute '__name__'

This is because the Collection instance is callable rather than being a plain view function. I've attached a patch that fixes this.

Attachments (1)

admindocs_view_index.diff (827 bytes) - added by Matthew Flanagan <mattimustang@…> 6 years ago.
fix for callable classes

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by Matthew Flanagan <mattimustang@…>

fix for callable classes

comment:1 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:2 Changed 5 years ago by jacob

  • milestone set to 1.1
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 5 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(In [10337]) Fixed #8889: make admindocs function view work with class-based views.

comment:4 Changed 5 years ago by jacob

(In [10339]) [1.0.X] Fixed #8889: make admindocs function view work with class-based views. Backport of r10337-r10338 from trunk.

comment:5 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.