mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #24752 -- query crash when reusing Case expressions
Case expressions weren't copied deep enough (self.cases list was reused resulting in an error).
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							9096e2b5f7
						
					
				
				
					commit
					7b05d2fdae
				
			| @@ -780,6 +780,11 @@ class Case(Expression): | ||||
|         c.default = c.default.resolve_expression(query, allow_joins, reuse, summarize, for_save) | ||||
|         return c | ||||
|  | ||||
|     def copy(self): | ||||
|         c = super(Case, self).copy() | ||||
|         c.cases = c.cases[:] | ||||
|         return c | ||||
|  | ||||
|     def as_sql(self, compiler, connection, template=None, extra=None): | ||||
|         connection.ops.check_expression_support(self) | ||||
|         if not self.cases: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user