summaryrefslogtreecommitdiff
path: root/docs/topics/http
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-06-04 16:58:23 -0700
committerTim Graham <timograham@gmail.com>2016-06-09 12:51:57 -0400
commit3b75d1262e8488cbbccfbe0ec186a107ea90dc6e (patch)
treefd6cb42656b83c1c279e02bd0848b80eb07317bd /docs/topics/http
parentfccb03fc4047386cf7219887ec6dd40d9f0ab61d (diff)
[1.10.x] Fixed #21588 -- Corrected handler initialization in "modifying upload handlers" example.
Backport of 8f50ff5b15a742f345dade0848a3fbbf2aff629d from master
Diffstat (limited to 'docs/topics/http')
-rw-r--r--docs/topics/http/file-uploads.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/topics/http/file-uploads.txt b/docs/topics/http/file-uploads.txt
index 8a7191ac1d..75ac1de452 100644
--- a/docs/topics/http/file-uploads.txt
+++ b/docs/topics/http/file-uploads.txt
@@ -229,7 +229,7 @@ For instance, suppose you've written a ``ProgressBarUploadHandler`` that
provides feedback on upload progress to some sort of AJAX widget. You'd add this
handler to your upload handlers like this::
- request.upload_handlers.insert(0, ProgressBarUploadHandler())
+ request.upload_handlers.insert(0, ProgressBarUploadHandler(request))
You'd probably want to use ``list.insert()`` in this case (instead of
``append()``) because a progress bar handler would need to run *before* any
@@ -238,7 +238,7 @@ other handlers. Remember, the upload handlers are processed in order.
If you want to replace the upload handlers completely, you can just assign a new
list::
- request.upload_handlers = [ProgressBarUploadHandler()]
+ request.upload_handlers = [ProgressBarUploadHandler(request)]
.. note::
@@ -266,7 +266,7 @@ list::
@csrf_exempt
def upload_file_view(request):
- request.upload_handlers.insert(0, ProgressBarUploadHandler())
+ request.upload_handlers.insert(0, ProgressBarUploadHandler(request))
return _upload_file_view(request)
@csrf_protect