upload: Reorder arguments to parallel upload_message_attachment.

This commit is contained in:
Alex Vandiver 2024-06-20 18:01:15 +00:00 committed by Tim Abbott
parent f52a93bc14
commit f97a30f240
3 changed files with 7 additions and 7 deletions

View File

@ -43,10 +43,10 @@ def check_upload_within_quota(realm: Realm, uploaded_file_size: int) -> None:
def create_attachment( def create_attachment(
file_name: str, file_name: str,
path_id: str, path_id: str,
content_type: str,
file_size: int,
user_profile: UserProfile, user_profile: UserProfile,
realm: Realm, realm: Realm,
file_size: int,
content_type: str,
) -> None: ) -> None:
assert (user_profile.realm_id == realm.id) or is_cross_realm_bot_email( assert (user_profile.realm_id == realm.id) or is_cross_realm_bot_email(
user_profile.delivery_email user_profile.delivery_email
@ -143,10 +143,10 @@ def upload_message_attachment(
create_attachment( create_attachment(
uploaded_file_name, uploaded_file_name,
path_id, path_id,
content_type,
len(file_data),
user_profile, user_profile,
target_realm, target_realm,
len(file_data),
content_type,
) )
return f"/user_uploads/{path_id}" return f"/user_uploads/{path_id}"

View File

@ -4527,7 +4527,7 @@ class MessageHasKeywordsTest(ZulipTestCase):
for file_name, path_id, size in dummy_files: for file_name, path_id, size in dummy_files:
create_attachment( create_attachment(
file_name, path_id, user_profile, user_profile.realm, size, "text/plain" file_name, path_id, "text/plain", size, user_profile, user_profile.realm
) )
# return path ids # return path ids

View File

@ -191,7 +191,7 @@ class ArchiveMessagesTestingBase(RetentionTestingBase):
for file_name, path_id, size in dummy_files: for file_name, path_id, size in dummy_files:
create_attachment( create_attachment(
file_name, path_id, user_profile, user_profile.realm, size, "text/plain" file_name, path_id, "text/plain", size, user_profile, user_profile.realm
) )
self.subscribe(user_profile, "Denmark") self.subscribe(user_profile, "Denmark")
@ -606,7 +606,7 @@ class MoveMessageToArchiveBase(RetentionTestingBase):
user_profile = self.example_user("hamlet") user_profile = self.example_user("hamlet")
for file_name, path_id, size in dummy_files: for file_name, path_id, size in dummy_files:
create_attachment( create_attachment(
file_name, path_id, user_profile, user_profile.realm, size, "text/plain" file_name, path_id, "text/plain", size, user_profile, user_profile.realm
) )
def _assert_archive_empty(self) -> None: def _assert_archive_empty(self) -> None: