summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-08-07 11:52:03 +1000
committerAndrew Godwin <andrew@aeracode.org>2014-08-07 11:52:31 +1000
commitdfe86449c9951824dfa95d44af36ef1d8e578bdc (patch)
treeefe7d14fd1d4cd0a8b3fdf3f2026e5ff5b9e8358 /django
parent938da36cb12c07c93a44bb1b77984427e809d213 (diff)
Fixed #23244: Error altering FK to non-FK in migrations
Diffstat (limited to 'django')
-rw-r--r--django/db/migrations/operations/fields.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/migrations/operations/fields.py b/django/db/migrations/operations/fields.py
index d1e98bde3f..55f27c1b6e 100644
--- a/django/db/migrations/operations/fields.py
+++ b/django/db/migrations/operations/fields.py
@@ -126,7 +126,7 @@ class AlterField(Operation):
if from_field.rel and from_field.rel.to:
if isinstance(from_field.rel.to, six.string_types):
from_field.rel.to = to_field.rel.to
- elif isinstance(to_field.rel.to, six.string_types):
+ elif to_field.rel and isinstance(to_field.rel.to, six.string_types):
to_field.rel.to = from_field.rel.to
schema_editor.alter_field(from_model, from_field, to_field)