summaryrefslogtreecommitdiff
path: root/django/http/multipartparser.py
diff options
context:
space:
mode:
authorДилян Палаузов <Dilyan.Palauzov@db.com>2017-12-27 00:14:12 +0530
committerTim Graham <timograham@gmail.com>2017-12-26 17:11:15 -0500
commit4c599ece57fa009cf3615f09497f81bfa6a585a7 (patch)
tree1f27a7e76024aaa5bc69356826061262d35d0be3 /django/http/multipartparser.py
parentc21f158295d92e35caf96436bfdbbff554fc5569 (diff)
downloaddjango-4c599ece57fa009cf3615f09497f81bfa6a585a7.tar.gz
Fixed #28930 -- Simplified code with any() and all().
Diffstat (limited to 'django/http/multipartparser.py')
-rw-r--r--django/http/multipartparser.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py
index 789a6610a5..f6f12ca718 100644
--- a/django/http/multipartparser.py
+++ b/django/http/multipartparser.py
@@ -277,11 +277,8 @@ class MultiPartParser:
exhaust(self._input_data)
# Signal that the upload has completed.
- for handler in handlers:
- retval = handler.upload_complete()
- if retval:
- break
-
+ # any() shortcircuits if a handler's upload_complete() returns a value.
+ any(handler.upload_complete() for handler in handlers)
self._post._mutable = False
return self._post, self._files