summaryrefslogtreecommitdiff
path: root/django/apps/registry.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-09-16 09:10:59 -0400
committerTim Graham <timograham@gmail.com>2015-09-17 09:56:41 -0400
commit12fd88d2a4b158cbb1bf4a66470714aeb85de47b (patch)
treee07f8fb64fcc2a1318fb165525302d01d3949d00 /django/apps/registry.py
parentda5747f8e460ea2a2d16f124463b3975ccfc0992 (diff)
downloaddjango-24215.tar.gz
Refs #24215 -- Fixed Python 3.5 compatiblity for unhandled lazy ops error.24215
Diffstat (limited to 'django/apps/registry.py')
-rw-r--r--django/apps/registry.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/apps/registry.py b/django/apps/registry.py
index 46c10ef4fb..3484d87aee 100644
--- a/django/apps/registry.py
+++ b/django/apps/registry.py
@@ -381,6 +381,10 @@ class Apps(object):
def function(model):
next_function = partial(supplied_fn, model)
+ # Annotate the function with its field for retrieval in
+ # migrations.state.StateApps.
+ if getattr(supplied_fn, 'keywords', None):
+ next_function.field = supplied_fn.keywords.get('field')
self.lazy_model_operation(next_function, *more_models)
# If the model is already loaded, pass it to the function immediately.