Fixed #27217 -- Fixed crash in CreateModel optimization with models that use mixins.

Thanks Simon Charette for review.
This commit is contained in:
Tim Graham 2016-09-28 10:04:52 -04:00 committed by GitHub
parent 9e07a9b5fe
commit a44fc008c4
2 changed files with 12 additions and 2 deletions

View file

@ -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: