diff options
| author | Tim Graham <timograham@gmail.com> | 2016-09-28 10:04:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-28 10:04:52 -0400 |
| commit | a44fc008c4e38fadef04021fdba564949f1aee3a (patch) | |
| tree | 2645fa7b9beca798521b666fbecab31727a26d67 /django/db | |
| parent | 9e07a9b5feb30fe06fb23d0e77edd34f6c3f92b5 (diff) | |
Fixed #27217 -- Fixed crash in CreateModel optimization with models that use mixins.
Thanks Simon Charette for review.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/migrations/operations/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py index a0e81f5e83..027ebfe95a 100644 --- a/django/db/migrations/operations/models.py +++ b/django/db/migrations/operations/models.py @@ -109,7 +109,10 @@ class CreateModel(ModelOperation): return True # Check we didn't inherit from the model - models_to_check = [base for base in self.bases if base is not models.Model] + models_to_check = [ + base for base in self.bases + if base is not models.Model and isinstance(base, (models.base.ModelBase, six.string_types)) + ] # Check we have no FKs/M2Ms with it for fname, field in self.fields: if field.remote_field: |
