mirror of
				https://github.com/django/django.git
				synced 2025-10-26 23:26:08 +00:00 
			
		
		
		
	[5.2.x] Fixed #36587 -- Clarified usage of list.insert() for upload handlers.
				
					
				
			Thanks Baptiste Mispelon for the report
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Backport of afe6634146 from main.
			
			
This commit is contained in:
		
							
								
								
									
										1
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								AUTHORS
									
									
									
									
									
								
							| @@ -206,6 +206,7 @@ answer newbie questions, and generally made Django that much better: | |||||||
|     Carlton Gibson <carlton.gibson@noumenal.es> |     Carlton Gibson <carlton.gibson@noumenal.es> | ||||||
|     cedric@terramater.net |     cedric@terramater.net | ||||||
|     Chad Whitman <chad.whitman@icloud.com> |     Chad Whitman <chad.whitman@icloud.com> | ||||||
|  |     Chaitanya Keyal <chaitanyakeyal@gmail.com> | ||||||
|     ChaosKCW |     ChaosKCW | ||||||
|     Charlie Leifer <coleifer@gmail.com> |     Charlie Leifer <coleifer@gmail.com> | ||||||
|     charly.wilhelm@gmail.com |     charly.wilhelm@gmail.com | ||||||
|   | |||||||
| @@ -288,9 +288,10 @@ handler to your upload handlers like this:: | |||||||
|  |  | ||||||
|     request.upload_handlers.insert(0, ProgressBarUploadHandler(request)) |     request.upload_handlers.insert(0, ProgressBarUploadHandler(request)) | ||||||
|  |  | ||||||
| You'd probably want to use ``list.insert()`` in this case (instead of | Using ``list.insert()``, as shown above, ensures that the progress bar handler | ||||||
| ``append()``) because a progress bar handler would need to run *before* any | is placed at the beginning of the list. Since upload handlers are executed in | ||||||
| other handlers. Remember, the upload handlers are processed in order. | order, this placement guarantees that the progress bar handler runs before the | ||||||
|  | default handlers, allowing it to track progress across the entire upload. | ||||||
|  |  | ||||||
| If you want to replace the upload handlers completely, you can assign a new | If you want to replace the upload handlers completely, you can assign a new | ||||||
| list:: | list:: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user