Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
uploads: Make realm_avatar_and_logo_path non-abstract.
Alex Vandiver43fe24a5a071
diff --git a/zerver/lib/upload/base.py b/zerver/lib/upload/base.pyindex 9d4eb775969..d7b9d565c45 100644--- a/zerver/lib/upload/base.py+++ b/zerver/lib/upload/base.py@@ -1,4 +1,5 @@import io+import osimport reimport unicodedatafrom typing import IO, Any, Callable, Optional, Tuple@@ -257,7 +258,7 @@ class ZulipUploadBackend:raise NotImplementedError()def realm_avatar_and_logo_path(self, realm: Realm) -> str:- raise NotImplementedError()+ return os.path.join(str(realm.id), "realm")def create_attachment(diff --git a/zerver/lib/upload/local.py b/zerver/lib/upload/local.pyindex 0d2394e3096..3ecbe85e110 100644--- a/zerver/lib/upload/local.py+++ b/zerver/lib/upload/local.py@@ -175,9 +175,6 @@ class LocalUploadBackend(ZulipUploadBackend):image_data = read_local_file("avatars", source_file_path + ".original")self.write_avatar_images(target_file_path, image_data)- def realm_avatar_and_logo_path(self, realm: Realm) -> str:- return os.path.join(str(realm.id), "realm")-def upload_realm_icon_image(self, icon_file: IO[bytes], user_profile: UserProfile) -> None:upload_path = self.realm_avatar_and_logo_path(user_profile.realm)image_data = icon_file.read()diff --git a/zerver/lib/upload/s3.py b/zerver/lib/upload/s3.pyindex 00703670025..f95b483bcbc 100644--- a/zerver/lib/upload/s3.py+++ b/zerver/lib/upload/s3.py@@ -312,9 +312,6 @@ class S3UploadBackend(ZulipUploadBackend):# export_path has a leading /return self.get_public_upload_url(export_path[1:])- def realm_avatar_and_logo_path(self, realm: Realm) -> str:- return os.path.join(str(realm.id), "realm")-def upload_realm_icon_image(self, icon_file: IO[bytes], user_profile: UserProfile) -> None:content_type = guess_type(icon_file.name)[0]s3_file_name = os.path.join(self.realm_avatar_and_logo_path(user_profile.realm), "icon")