mirror of
https://github.com/django/django.git
synced 2025-10-28 16:16:12 +00:00
Fixed #9602 -- Added AdminSite.get_model_admin().
This allows retrieving an admin class for the given model class without using internal attributes.
This commit is contained in:
@@ -276,8 +276,7 @@ class SystemChecksTestCase(SimpleTestCase):
|
||||
class MyBookAdmin(admin.ModelAdmin):
|
||||
def check(self, **kwargs):
|
||||
errors = super().check(**kwargs)
|
||||
author_admin = self.admin_site._registry.get(Author)
|
||||
if author_admin is None:
|
||||
if not self.admin_site.is_registered(Author):
|
||||
errors.append("AuthorAdmin missing!")
|
||||
return errors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user