mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #23244: Error altering FK to non-FK in migrations
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user