mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #25329 -- Prevented _nodb_connection from being left open
This commit is contained in:
		
				
					committed by
					
						 Claude Paroz
						Claude Paroz
					
				
			
			
				
	
			
			
			
						parent
						
							d3c92afe42
						
					
				
				
					commit
					b2f6e421a3
				
			| @@ -569,10 +569,10 @@ class BaseDatabaseWrapper(object): | ||||
|             if must_close: | ||||
|                 self.close() | ||||
|  | ||||
|     @cached_property | ||||
|     @property | ||||
|     def _nodb_connection(self): | ||||
|         """ | ||||
|         Alternative connection to be used when there is no need to access | ||||
|         Return an alternative connection to be used when there is no need to access | ||||
|         the main database, specifically for test db creation/deletion. | ||||
|         This also prevents the production database from being exposed to | ||||
|         potential child threads while (or after) the test database is destroyed. | ||||
|   | ||||
| @@ -232,7 +232,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): | ||||
|         else: | ||||
|             return True | ||||
|  | ||||
|     @cached_property | ||||
|     @property | ||||
|     def _nodb_connection(self): | ||||
|         nodb_connection = super(DatabaseWrapper, self)._nodb_connection | ||||
|         try: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user