Code

Ticket #8519: 8519-1.diff

File 8519-1.diff, 1.1 KB (added by mattmcc, 6 years ago)
Line 
1Index: django/contrib/databrowse/sites.py
2===================================================================
3--- django/contrib/databrowse/sites.py  (revision 8524)
4+++ django/contrib/databrowse/sites.py  (working copy)
5@@ -89,7 +89,7 @@
6             model_or_iterable = [model_or_iterable]
7         for model in model_or_iterable:
8             if model in self.registry:
9-                raise AlreadyRegistered('The model %s is already registered' % model.__class__.__name__)
10+                raise AlreadyRegistered('The model %s is already registered' % model.__name__)
11             self.registry[model] = databrowse_class
12 
13     def unregister(self, model_or_iterable):
14@@ -102,7 +102,7 @@
15             model_or_iterable = [model_or_iterable]
16         for model in model_or_iterable:
17             if model not in self.registry:
18-                raise NotRegistered('The model %s is not registered' % model.__class__.__name__)
19+                raise NotRegistered('The model %s is not registered' % model.__name__)
20             del self.registry[model]
21 
22     def root(self, request, url):