python: Normalize quotes with Black.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-11 23:20:45 -08:00
committed by Tim Abbott
parent 11741543da
commit 6e4c3e41dc
989 changed files with 32792 additions and 32792 deletions

View File

@@ -13,8 +13,8 @@ from zerver.models import UserProfile, validate_attachment_request
def validate_thumbnail_request(user_profile: UserProfile, path: str) -> Optional[bool]:
# path here does not have a leading / as it is parsed from request hitting the
# thumbnail endpoint (defined in urls.py) that way.
if path.startswith('user_uploads/'):
path_id = path[len('user_uploads/') :]
if path.startswith("user_uploads/"):
path_id = path[len("user_uploads/") :]
return validate_attachment_request(user_profile, path_id)
# This is an external link and we don't enforce restricted view policy here.
@@ -32,10 +32,10 @@ def backend_serve_thumbnail(
return HttpResponseForbidden(_("<p>You are not authorized to view this file.</p>"))
size = None
if size_requested == 'thumbnail':
size = '0x300'
elif size_requested == 'full':
size = '0x0'
if size_requested == "thumbnail":
size = "0x300"
elif size_requested == "full":
size = "0x0"
if size is None:
return HttpResponseForbidden(_("<p>Invalid size.</p>"))