mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] Fixed #24146 -- Allowed model._meta.get_field() to be used after apps.models_ready
Backport of 19188826b4 from master
This commit is contained in:
committed by
Tim Graham
parent
c6a49d4f17
commit
fdcc9c47d5
@@ -535,7 +535,7 @@ class Options(object):
|
||||
except KeyError:
|
||||
# If the app registry is not ready, reverse fields are
|
||||
# unavailable, therefore we throw a FieldDoesNotExist exception.
|
||||
if not self.apps.ready:
|
||||
if not self.apps.models_ready:
|
||||
raise FieldDoesNotExist(
|
||||
"%s has no field named %r. The app cache isn't ready yet, "
|
||||
"so if this is an auto-created related field, it won't "
|
||||
|
||||
Reference in New Issue
Block a user