mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
upload: Don't access emoji_file.name attribute upload_emoji_image.
The S3 backend implementation of upload_emoji_image was accessing emoji_file.name - which is redundant because emoji_file_name already gets passed in and can be used, and an object of type IO[bytes] may not have the .name attribute. Spotted by @Fingel.
This commit is contained in:
committed by
Tim Abbott
parent
e3080f2db4
commit
fe61243cfe
@@ -684,7 +684,7 @@ class S3UploadBackend(ZulipUploadBackend):
|
|||||||
def upload_emoji_image(
|
def upload_emoji_image(
|
||||||
self, emoji_file: IO[bytes], emoji_file_name: str, user_profile: UserProfile
|
self, emoji_file: IO[bytes], emoji_file_name: str, user_profile: UserProfile
|
||||||
) -> bool:
|
) -> bool:
|
||||||
content_type = guess_type(emoji_file.name)[0]
|
content_type = guess_type(emoji_file_name)[0]
|
||||||
emoji_path = RealmEmoji.PATH_ID_TEMPLATE.format(
|
emoji_path = RealmEmoji.PATH_ID_TEMPLATE.format(
|
||||||
realm_id=user_profile.realm_id,
|
realm_id=user_profile.realm_id,
|
||||||
emoji_file_name=emoji_file_name,
|
emoji_file_name=emoji_file_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user