diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/autodetector.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py index 2b8759b29a..868d2bdc0f 100644 --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -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 |
