Add a signal to notifying when a ModelAdmin has been registered with an AdminSite
|Reported by:||filip.dupanovic@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When your trying to unregister a ModelAdmin instance from a particular AdminSite, it's possible that at the point of time the statement is being executed the ModelAdmin hasn't been registered and you'll get an unhandled exception.
The only way to resolve this is to rearrange the INSTALLED_APPS to make sure the particular application's modules are being imported after the ModelAdmin has been registered. If we can latch onto a signal that will notify us when a site instance has had a ModelAdmin registered, we'd have a more elegant approach to unregistering model administration we don't want to appear on the admin site.