diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2021-11-19 21:45:33 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-11-22 06:46:25 +0100 |
| commit | a0ed3cfad1ac4873ecfd2baebaa2e978e483ba99 (patch) | |
| tree | 7ef2d63a8486514a1003af81fdbe1a302bbd357e /django | |
| parent | a7e7043c8746933dafce652507d3b821801cdc7d (diff) | |
Fixed #33305 -- Fixed autodetector crash for ForeignKey with hardcoded "to" attribute.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/autodetector.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py index 97977d72ef..bf9c2acd26 100644 --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -96,7 +96,7 @@ class MigrationAutodetector: for name, field in sorted(fields.items()): deconstruction = self.deep_deconstruct(field) if field.remote_field and field.remote_field.model: - del deconstruction[2]['to'] + deconstruction[2].pop('to', None) fields_def.append(deconstruction) return fields_def |
