mirror of
				https://gitlab.crans.org/bde/nk20-scripts
				synced 2025-11-04 08:32:10 +01:00 
			
		
		
		
	fix inversed logic for detection of multi inherited table
This commit is contained in:
		@@ -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):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user