mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 08:33:43 +00:00
upload: Stop requiring callers pass in the file size.
This can be calculated because we have the contents.
This commit is contained in:
committed by
Tim Abbott
parent
58a9fe9af1
commit
f52a93bc14
@@ -1,4 +1,3 @@
|
||||
import os
|
||||
from datetime import timedelta
|
||||
from typing import Any, Dict, List, Mapping, Type, Union
|
||||
|
||||
@@ -145,10 +144,8 @@ class Command(ZulipBaseCommand):
|
||||
|
||||
# Create an attachment in the database for set_storage_space_used_statistic.
|
||||
IMAGE_FILE_PATH = static_path("images/test-images/checkbox.png")
|
||||
file_info = os.stat(IMAGE_FILE_PATH)
|
||||
file_size = file_info.st_size
|
||||
with open(IMAGE_FILE_PATH, "rb") as fp:
|
||||
upload_message_attachment_from_request(UploadedFile(fp), shylock, file_size)
|
||||
upload_message_attachment_from_request(UploadedFile(fp), shylock)
|
||||
|
||||
FixtureData: TypeAlias = Mapping[Union[str, int, None], List[int]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user