Opened 8 years ago

Closed 8 years ago

Last modified 5 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@…> 8 years ago.
fix for callable classes

Download all attachments as: .zip

Change History (6)

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

Attachment: admindocs_view_index.diff added

fix for callable classes

comment:1 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:2 Changed 8 years ago by Jacob

milestone: 1.1
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

comment:3 Changed 8 years ago by Jacob

Resolution: fixed
Status: newclosed

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

comment:4 Changed 8 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 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top