Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upload: Rename backend to store_single_emoji_image.

Alex Vandiver3026d16d336b
diff --git a/zerver/lib/upload/__init__.py b/zerver/lib/upload/__init__.py
index d6ac133cddc..be03efad907 100644
--- a/zerver/lib/upload/__init__.py
+++ b/zerver/lib/upload/__init__.py
@@ -515,7 +515,7 @@ def upload_emoji_image(
)
image_data = emoji_file.read()
- backend.upload_single_emoji_image(
+ backend.store_single_emoji_image(
f"{emoji_path}.original", content_type, user_profile, image_data
)
resized_image_data, still_image_data = resize_emoji(image_data, emoji_file_name)
@@ -524,7 +524,7 @@ def upload_emoji_image(
raise BadImageError(_("Image size exceeds limit"))
elif len(resized_image_data) > MAX_EMOJI_GIF_FILE_SIZE_BYTES: # nocoverage
raise BadImageError(_("Image size exceeds limit"))
- backend.upload_single_emoji_image(emoji_path, content_type, user_profile, resized_image_data)
+ backend.store_single_emoji_image(emoji_path, content_type, user_profile, resized_image_data)
if still_image_data is None:
return False
@@ -532,7 +532,7 @@ def upload_emoji_image(
realm_id=user_profile.realm_id,
emoji_filename_without_extension=os.path.splitext(emoji_file_name)[0],
)
- backend.upload_single_emoji_image(still_path, "image/png", user_profile, still_image_data)
+ backend.store_single_emoji_image(still_path, "image/png", user_profile, still_image_data)
return True
diff --git a/zerver/lib/upload/base.py b/zerver/lib/upload/base.py
index 95e71e8bbb2..6edae3d8bb3 100644
--- a/zerver/lib/upload/base.py
+++ b/zerver/lib/upload/base.py
@@ -130,7 +130,7 @@ class ZulipUploadBackend:
def get_emoji_url(self, emoji_file_name: str, realm_id: int, still: bool = False) -> str:
raise NotImplementedError
- def upload_single_emoji_image(
+ def store_single_emoji_image(
self,
path: str,
content_type: str | None,
diff --git a/zerver/lib/upload/local.py b/zerver/lib/upload/local.py
index 6c58ceefdd7..fc2a6bad17a 100644
--- a/zerver/lib/upload/local.py
+++ b/zerver/lib/upload/local.py
@@ -235,7 +235,7 @@ class LocalUploadBackend(ZulipUploadBackend):
)
@override
- def upload_single_emoji_image(
+ def store_single_emoji_image(
self, path: str, content_type: str | None, user_profile: UserProfile, image_data: bytes
) -> None:
write_local_file("avatars", path, image_data)
diff --git a/zerver/lib/upload/s3.py b/zerver/lib/upload/s3.py
index eeadecf2863..00b88a7d95b 100644
--- a/zerver/lib/upload/s3.py
+++ b/zerver/lib/upload/s3.py
@@ -480,7 +480,7 @@ class S3UploadBackend(ZulipUploadBackend):
return self.get_public_upload_url(emoji_path)
@override
- def upload_single_emoji_image(
+ def store_single_emoji_image(
self, path: str, content_type: str | None, user_profile: UserProfile, image_data: bytes
) -> None:
upload_content_to_s3(