Fixed #28982 -- Simplified code with and/or.

This commit is contained in:
Дилян Палаузов 2018-01-03 18:52:12 -05:00 committed by Tim Graham
parent c2d0f8c084
commit d7b2aa24f7
55 changed files with 98 additions and 218 deletions

View file

@ -85,9 +85,7 @@ class HashedFilesMixin:
# `name` is the base name to construct the new hashed filename from.
parsed_name = urlsplit(unquote(name))
clean_name = parsed_name.path.strip()
if filename:
filename = urlsplit(unquote(filename)).path.strip()
filename = filename or clean_name
filename = (filename and urlsplit(unquote(filename)).path.strip()) or clean_name
opened = False
if content is None:
if not self.exists(filename):