diff options
| author | Markus Holtermann <info@markusholtermann.eu> | 2015-04-30 01:39:50 +0200 |
|---|---|---|
| committer | Markus Holtermann <info@markusholtermann.eu> | 2015-04-30 13:46:24 +0200 |
| commit | bf4dc5733fec86e7dfcdeddbcf4ce047c0b2f922 (patch) | |
| tree | 7bf19c3c82fac3dd0a886ef559f904d18068d068 /django | |
| parent | 49dea4164ad9540bcd73ea320e62b1ba054d421b (diff) | |
[1.8.x] Fixed #24725 -- Allowed renaming of target models in ManyToMany relations
This is a regression caused by introducing rendered migration states in
1aa3e09c2043 and the _meta refactoring in fb48eb05816b.
Thanks to Danilo Bargen for reporting the issue and Marten Kenbeek and
Tim Graham for triaging the bug and providing the initial test case.
Backport of 63f9b633f9cb620a4c4764b47dca127706a8d7b4 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/operations/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py index 2d75836da9..c0eb92a0ef 100644 --- a/django/db/migrations/operations/models.py +++ b/django/db/migrations/operations/models.py @@ -161,7 +161,7 @@ class RenameModel(Operation): # Get all of the related objects we need to repoint all_related_objects = ( f for f in model._meta.get_fields(include_hidden=True) - if f.auto_created and not f.concrete and not (f.hidden or f.many_to_many) + if f.auto_created and not f.concrete and (not f.hidden or f.many_to_many) ) # Rename the model state.models[app_label, self.new_name_lower] = state.models[app_label, self.old_name_lower] |
