From 22481f63bfdd8340365519c0383aec0ed0a8f1b3 Mon Sep 17 00:00:00 2001 From: Wyatt Hoodes Date: Thu, 25 Jul 2019 21:26:48 -1000 Subject: [PATCH] upload: Fix typing for key variable. --- zerver/lib/upload.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/lib/upload.py b/zerver/lib/upload.py index d2f9aee64a..065347ba15 100644 --- a/zerver/lib/upload.py +++ b/zerver/lib/upload.py @@ -316,7 +316,7 @@ def get_signed_upload_url(path: str) -> str: def get_realm_for_filename(path: str) -> Optional[int]: conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY) - key = get_bucket(conn, settings.S3_AUTH_UPLOADS_BUCKET).get_key(path) + key = get_bucket(conn, settings.S3_AUTH_UPLOADS_BUCKET).get_key(path) # type: Optional[Key] if key is None: # This happens if the key does not exist. return None @@ -328,7 +328,7 @@ class S3UploadBackend(ZulipUploadBackend): bucket = get_bucket(conn, bucket_name) # check if file exists - key = bucket.get_key(path_id) + key = bucket.get_key(path_id) # type: Optional[Key] if key is not None: bucket.delete_key(key) return True