mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
newforms-admin: Fixed #4571 -- Clarified type check to allow multiple class registrations with an admin site. Thanks to Jakub Vysoky for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5999 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5303028b32
commit
a29582a1d9
@ -72,7 +72,7 @@ class AdminSite(object):
|
||||
"""
|
||||
admin_class = admin_class or ModelAdmin
|
||||
# TODO: Handle options
|
||||
if issubclass(model_or_iterable, Model):
|
||||
if type(model_or_iterable) not in (list, tuple):
|
||||
model_or_iterable = [model_or_iterable]
|
||||
for model in model_or_iterable:
|
||||
if model in self._registry:
|
||||
@ -85,7 +85,7 @@ class AdminSite(object):
|
||||
|
||||
If a model isn't already registered, this will raise NotRegistered.
|
||||
"""
|
||||
if issubclass(model_or_iterable, Model):
|
||||
if type(model_or_iterable) not in (list, tuple):
|
||||
model_or_iterable = [model_or_iterable]
|
||||
for model in model_or_iterable:
|
||||
if model not in self._registry:
|
||||
|
Loading…
x
Reference in New Issue
Block a user