Skip to content

Commit

Permalink
Fixed django#8519: report the correct class in databrowse's `AlreadyR…
Browse files Browse the repository at this point in the history
…egistered` error. Thanks, mattmcc.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Aug 25, 2008
1 parent 0a6314f commit ab7eabf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/contrib/databrowse/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def register(self, model_or_iterable, databrowse_class=None, **options):
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):
Expand All @@ -102,7 +102,7 @@ def unregister(self, model_or_iterable):
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):
Expand Down

0 comments on commit ab7eabf

Please sign in to comment.