mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #33433 -- Avoided unnecessary resolve() calls in technical_404_response().
Thanks Keryn Knight for the initial patch.
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							75c1127eef
						
					
				
				
					commit
					18a15bbc9c
				
			| @@ -537,11 +537,13 @@ def technical_404_response(request, exception): | ||||
|         urlconf = urlconf.__name__ | ||||
|  | ||||
|     caller = '' | ||||
|     try: | ||||
|         resolver_match = resolve(request.path) | ||||
|     except Http404: | ||||
|         pass | ||||
|     else: | ||||
|     resolver_match = request.resolver_match | ||||
|     if resolver_match is None: | ||||
|         try: | ||||
|             resolver_match = resolve(request.path) | ||||
|         except Http404: | ||||
|             pass | ||||
|     if resolver_match is not None: | ||||
|         obj = resolver_match.func | ||||
|  | ||||
|         if hasattr(obj, 'view_class'): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user