upload: Remove incorrect animated GIF asserts.

GIF files can be `.GIF`, and also we determine the file format by
inspecting the image data, so there's no reason to have this
assertion.

(The code for serving still images does not rely on the file being a
GIF.)
This commit is contained in:
Tim Abbott
2021-12-16 16:12:44 -08:00
parent 7f8ea5b9f2
commit 22b5e105e6

View File

@@ -715,8 +715,6 @@ class S3UploadBackend(ZulipUploadBackend):
def get_emoji_url(self, emoji_file_name: str, realm_id: int, still: bool = False) -> str:
if still:
# We currently only support animated GIFs.
assert emoji_file_name.endswith(".gif")
emoji_path = RealmEmoji.STILL_PATH_ID_TEMPLATE.format(
realm_id=realm_id,
emoji_filename_without_extension=os.path.splitext(emoji_file_name)[0],
@@ -968,8 +966,6 @@ class LocalUploadBackend(ZulipUploadBackend):
def get_emoji_url(self, emoji_file_name: str, realm_id: int, still: bool = False) -> str:
if still:
# We currently only support animated GIFs.
assert emoji_file_name.endswith(".gif")
return os.path.join(
"/user_avatars",
RealmEmoji.STILL_PATH_ID_TEMPLATE.format(