mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Simplified TemplateDetailView with pathlib.Path.read_text().
This commit is contained in:
		
				
					committed by
					
						 Carlton Gibson
						Carlton Gibson
					
				
			
			
				
	
			
			
			
						parent
						
							f97a6123c0
						
					
				
				
					commit
					62254c5202
				
			| @@ -330,8 +330,7 @@ class TemplateDetailView(BaseAdminDocsView): | ||||
|             for index, directory in enumerate(default_engine.dirs): | ||||
|                 template_file = Path(directory) / template | ||||
|                 if template_file.exists(): | ||||
|                     with template_file.open() as f: | ||||
|                         template_contents = f.read() | ||||
|                     template_contents = template_file.read_text() | ||||
|                 else: | ||||
|                     template_contents = '' | ||||
|                 templates.append({ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user