Opened 16 years ago

Closed 15 years ago

Last modified 13 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: no UI/UX: no

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@…> 16 years ago.
fix for callable classes

Download all attachments as: .zip

Change History (6)

by Matthew Flanagan <mattimustang@…>, 16 years ago

Attachment: admindocs_view_index.diff added

fix for callable classes

comment:1 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:2 by Jacob, 15 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:3 by Jacob, 15 years ago

Resolution: fixed
Status: newclosed

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

comment:4 by Jacob, 15 years ago

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

comment:5 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

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