This commit is contained in:
Matthias 2021-11-17 01:51:47 +01:00
parent c3ea0f0704
commit 7c9ba1007d
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -219,11 +219,11 @@ class PluginAppConfig(AppConfig):
self._reload_apps(populate=True)
self._reload_apps()
# rediscover models/ admin sites
self._reload_contrib()
self._reregister_contrib_apps()
# update urls - must be last as models must be registered for creating admin routes
self._update_urls()
def _reload_contrib(self):
def _reregister_contrib_apps(self):
"""fix reloading of contrib apps - models and admin
this is needed if plugins were loaded earlier and then reloaded as models and admins rely on imports
those register models and admin in their respective objects (e.g. admin.site for admin)