upload: Use get_export_tarball_url in upload_export_tarball.

This commit is contained in:
Alex Vandiver 2022-04-06 16:52:23 -07:00 committed by Tim Abbott
parent 4cf835d9dd
commit 1a7b3ef7ed
2 changed files with 2 additions and 4 deletions

View File

@ -241,8 +241,7 @@ class LocalUploadBackend(ZulipUploadBackend):
abs_path = os.path.join(assert_is_not_none(settings.LOCAL_AVATARS_DIR), path)
os.makedirs(os.path.dirname(abs_path), exist_ok=True)
shutil.copy(tarball_path, abs_path)
public_url = realm.url + "/user_avatars/" + path
return public_url
return self.get_export_tarball_url(realm, "/user_avatars/" + path)
@override
def delete_export_tarball(self, export_path: str) -> str | None:

View File

@ -445,8 +445,7 @@ class S3UploadBackend(ZulipUploadBackend):
else:
key.upload_file(Filename=tarball_path, Callback=percent_callback)
public_url = self.get_public_upload_url(key.key)
return public_url
return self.get_export_tarball_url(realm, key.key)
@override
def delete_export_tarball(self, export_path: str) -> str | None: