mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #27217 -- Fixed crash in CreateModel optimization with models that use mixins.
Thanks Simon Charette for review.
This commit is contained in:
parent
9e07a9b5fe
commit
a44fc008c4
2 changed files with 12 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue