mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
upload: Pass down content-type of realm icon/logo to backend.
This saves having to try to re-derive it from the file extension, which may be ".original" in some cases.
This commit is contained in:
committed by
Tim Abbott
parent
b050c644e3
commit
ff90e5355f
@@ -138,7 +138,9 @@ class LocalUploadBackend(ZulipUploadBackend):
|
||||
return f"/user_avatars/{realm_id}/realm/icon.png?version={version}"
|
||||
|
||||
@override
|
||||
def upload_realm_icon_image(self, icon_file: IO[bytes], user_profile: UserProfile) -> None:
|
||||
def upload_realm_icon_image(
|
||||
self, icon_file: IO[bytes], user_profile: UserProfile, content_type: str
|
||||
) -> None:
|
||||
upload_path = self.realm_avatar_and_logo_path(user_profile.realm)
|
||||
image_data = icon_file.read()
|
||||
write_local_file("avatars", os.path.join(upload_path, "icon.original"), image_data)
|
||||
@@ -156,7 +158,7 @@ class LocalUploadBackend(ZulipUploadBackend):
|
||||
|
||||
@override
|
||||
def upload_realm_logo_image(
|
||||
self, logo_file: IO[bytes], user_profile: UserProfile, night: bool
|
||||
self, logo_file: IO[bytes], user_profile: UserProfile, night: bool, content_type: str
|
||||
) -> None:
|
||||
upload_path = self.realm_avatar_and_logo_path(user_profile.realm)
|
||||
if night:
|
||||
|
||||
Reference in New Issue
Block a user