Fixed #24146 -- Allowed model._meta.get_field() to be used after apps.models_ready

This commit is contained in:
Daniel Pyrathon 2015-02-10 18:15:54 +01:00 committed by Tim Graham
parent 1fbe8a2de3
commit 19188826b4
4 changed files with 21 additions and 3 deletions

View file

@ -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 "