summaryrefslogtreecommitdiff
path: root/django/db/models/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/base.py')
-rw-r--r--django/db/models/base.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index e802dd955d..8037764dd8 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -1459,6 +1459,8 @@ def model_unpickle(model_id, attrs, factory):
Used to unpickle Model subclasses with deferred fields.
"""
if isinstance(model_id, tuple):
+ if not apps.ready:
+ apps.populate(settings.INSTALLED_APPS)
model = apps.get_model(*model_id)
else:
# Backwards compat - the model was cached directly in earlier versions.