Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4571 closed (fixed)

small patch for multi model admin.site registering

Reported by: Jakub Vysoky [kvbik] Owned by: adrian
Component: contrib.admin Version: newforms-admin
Severity: Keywords: issubclass model_or_iterable
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

the code bellow:

from django.contrib import admin
admin.site.register([Model1, Model2], SomeAdminClass)

would cause error:

proj.app: issubclass() arg 1 must be a class

when calling issubclass(model_or_iterable, Model),
it would complain that model_or_iterable is not class (because it's instance of list).

Attachments (1)

django_newadmin_iterable.diff (916 bytes) - added by Jakub Vysoky 8 years ago.
issubclass => is not tuple or list

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by Jakub Vysoky

issubclass => is not tuple or list

comment:1 Changed 8 years ago by russellm

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

(In [5999]) newforms-admin: Fixed #4571 -- Clarified type check to allow multiple class registrations with an admin site. Thanks to Jakub Vysoky for the patch.

comment:2 Changed 8 years ago by russellm

(In [6000]) newforms-admin: Fixed #4810, Refs #4571 -- Reversed the logic for the type check introduced in [5999]; this way should be a little more robust from an error handling point of view. Thanks to ubernostrum for the suggestion. Oh, and Changeset 6000!! w00t!!

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