mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #22030 -- Don't assume that all fields have a swappable_setting attribute.
This commit is contained in:
@@ -233,7 +233,8 @@ class MigrationAutodetector(object):
|
||||
field=field,
|
||||
)
|
||||
)
|
||||
swappable_setting = new_apps.get_model(app_label, model_name)._meta.get_field_by_name(field_name)[0].swappable_setting
|
||||
new_field = new_apps.get_model(app_label, model_name)._meta.get_field_by_name(field_name)[0]
|
||||
swappable_setting = getattr(new_field, 'swappable_setting', None)
|
||||
if swappable_setting is not None:
|
||||
self.add_swappable_dependency(app_label, swappable_setting)
|
||||
# Old fields
|
||||
|
||||
Reference in New Issue
Block a user