mirror of
https://github.com/django/django.git
synced 2025-10-28 08:06:09 +00:00
Added check_apps_ready() to Apps.get_containing_app_config()
This commit is contained in:
@@ -227,9 +227,7 @@ class Apps(object):
|
||||
Returns the app config for the inner application in case of nesting.
|
||||
Returns None if the object isn't in any registered app config.
|
||||
"""
|
||||
# In Django 1.7 and 1.8, it's allowed to call this method at import
|
||||
# time, even while the registry is being populated. In Django 1.9 and
|
||||
# later, that should be forbidden with `self.check_apps_ready()`.
|
||||
self.check_apps_ready()
|
||||
candidates = []
|
||||
for app_config in self.app_configs.values():
|
||||
if object_name.startswith(app_config.name):
|
||||
|
||||
Reference in New Issue
Block a user