diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2014-02-13 12:23:12 +0100 |
|---|---|---|
| committer | Baptiste Mispelon <bmispelon@gmail.com> | 2014-02-13 17:43:21 +0100 |
| commit | 6873eeeefbc3a081c98351ff25b4cdc42dbf3d7d (patch) | |
| tree | d9e0b442745eebde39a2a1c4a955654b691f0a8d /django | |
| parent | c3434fed5bb223b2765a85f88053d42b70d81ad9 (diff) | |
Fixed #22030 -- Don't assume that all fields have a swappable_setting attribute.
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 |
