Fixed #8519: report the correct class in databrowse's `AlreadyRegistered` error. Thanks, mattmcc.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2008-08-25 18:32:26 +00:00
parent 0a6314f249
commit ab7eabfcd1
1 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class DatabrowseSite(object):
model_or_iterable = [model_or_iterable]
for model in model_or_iterable:
if model in self.registry:
raise AlreadyRegistered('The model %s is already registered' % model.__class__.__name__)
raise AlreadyRegistered('The model %s is already registered' % model.__name__)
self.registry[model] = databrowse_class
def unregister(self, model_or_iterable):
@ -102,7 +102,7 @@ class DatabrowseSite(object):
model_or_iterable = [model_or_iterable]
for model in model_or_iterable:
if model not in self.registry:
raise NotRegistered('The model %s is not registered' % model.__class__.__name__)
raise NotRegistered('The model %s is not registered' % model.__name__)
del self.registry[model]
def root(self, request, url):