summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-08-24 13:38:10 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-08-24 13:38:10 +0000
commita29582a1d994f3294bee0156cba328f8e19685ee (patch)
treebc46c0c527b1daf474e2ee5c6d83e4154f901a74
parent5303028b32fd5c8b8febc9907a70b637ce020e39 (diff)
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
-rw-r--r--django/contrib/admin/sites.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index 9808128490..2a6bb4c7f5 100644
--- a/django/contrib/admin/sites.py
+++ b/django/contrib/admin/sites.py
@@ -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: