summaryrefslogtreecommitdiff
path: root/django/db/migrations/state.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/db/migrations/state.py
parentda5747f8e460ea2a2d16f124463b3975ccfc0992 (diff)
downloaddjango-24215.tar.gz
Refs #24215 -- Fixed Python 3.5 compatiblity for unhandled lazy ops error.24215
Diffstat (limited to 'django/db/migrations/state.py')
-rw-r--r--django/db/migrations/state.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/django/db/migrations/state.py b/django/db/migrations/state.py
index 3613ae2a4d..0defa7018e 100644
--- a/django/db/migrations/state.py
+++ b/django/db/migrations/state.py
@@ -244,11 +244,7 @@ class StateApps(Apps):
has a keyword argument called 'field'.
"""
def extract_field(operation):
- # Expect a functools.partial() with a kwarg called 'field' applied.
- try:
- return operation.func.keywords['field']
- except (AttributeError, KeyError):
- return None
+ return getattr(operation, 'field', None)
def extract_field_names(operations):
return (str(field) for field in map(extract_field, operations) if field)