mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[3.1.x] Refs #21171 -- Made Collector.delete() rollback in the correct database.
Regression in c7dd8490b882b2cefdc7faf431dc64c532b79c9.
Backport of f8ef5f2c86 from master
			
			
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							bd389a832a
						
					
				
				
					commit
					aca675ad33
				
			| @@ -392,7 +392,7 @@ class Collector: | ||||
|         if len(self.data) == 1 and len(instances) == 1: | ||||
|             instance = list(instances)[0] | ||||
|             if self.can_fast_delete(instance): | ||||
|                 with transaction.mark_for_rollback_on_error(): | ||||
|                 with transaction.mark_for_rollback_on_error(self.using): | ||||
|                     count = sql.DeleteQuery(model).delete_batch([instance.pk], self.using) | ||||
|                 setattr(instance, model._meta.pk.attname, None) | ||||
|                 return count, {model._meta.label: count} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user