fix inversed logic for detection of multi inherited table
This commit is contained in:
parent
5a4e3473be
commit
ddde4a2c53
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue