diff options
author | Дилян Палаузов <Dilyan.Palauzov@db.com> | 2017-12-27 00:14:12 +0530 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2017-12-26 17:11:15 -0500 |
commit | 4c599ece57fa009cf3615f09497f81bfa6a585a7 (patch) | |
tree | 1f27a7e76024aaa5bc69356826061262d35d0be3 /django/http/multipartparser.py | |
parent | c21f158295d92e35caf96436bfdbbff554fc5569 (diff) | |
download | django-4c599ece57fa009cf3615f09497f81bfa6a585a7.tar.gz |
Fixed #28930 -- Simplified code with any() and all().
Diffstat (limited to 'django/http/multipartparser.py')
-rw-r--r-- | django/http/multipartparser.py | 7 |
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 |