fix inversed logic for detection of multi inherited table

This commit is contained in:
Pierre-antoine Comby 2020-05-25 01:16:08 +02:00
parent 5a4e3473be
commit ddde4a2c53
1 changed files with 3 additions and 3 deletions

View File

@ -83,13 +83,13 @@ class BulkCreateManager(object):
# check for mutli-table inheritance it happens
# if model_class is a grand-child of PolymorphicModel
if model_class.__base__ is not PolymorphicModel and model_class.__base__.__base__ is PolymorphicModel:
model_class.objects.bulk_create(self._create_queues[model_key])
else:
# ensure that parents models exists
self._commit(model_class.__base__)
with transaction.atomic():
for obj in self._create_queues[model_key]:
obj.save_base(raw=True)
else:
# ensure that parents models exists
model_class.objects.bulk_create(self._create_queues[model_key])
self._create_queues[model_key] = []
def add(self, *args):