From a29582a1d994f3294bee0156cba328f8e19685ee Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 24 Aug 2007 13:38:10 +0000 Subject: [PATCH] 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 --- django/contrib/admin/sites.py | 4 ++-- 1 file 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: