mirror of https://github.com/zulip/zulip.git
upload: Reorder arguments to parallel upload_message_attachment.
This commit is contained in:
parent
f52a93bc14
commit
f97a30f240
|
@ -43,10 +43,10 @@ def check_upload_within_quota(realm: Realm, uploaded_file_size: int) -> None:
|
|||
def create_attachment(
|
||||
file_name: str,
|
||||
path_id: str,
|
||||
content_type: str,
|
||||
file_size: int,
|
||||
user_profile: UserProfile,
|
||||
realm: Realm,
|
||||
file_size: int,
|
||||
content_type: str,
|
||||
) -> None:
|
||||
assert (user_profile.realm_id == realm.id) or is_cross_realm_bot_email(
|
||||
user_profile.delivery_email
|
||||
|
@ -143,10 +143,10 @@ def upload_message_attachment(
|
|||
create_attachment(
|
||||
uploaded_file_name,
|
||||
path_id,
|
||||
content_type,
|
||||
len(file_data),
|
||||
user_profile,
|
||||
target_realm,
|
||||
len(file_data),
|
||||
content_type,
|
||||
)
|
||||
return f"/user_uploads/{path_id}"
|
||||
|
||||
|
|
|
@ -4527,7 +4527,7 @@ class MessageHasKeywordsTest(ZulipTestCase):
|
|||
|
||||
for file_name, path_id, size in dummy_files:
|
||||
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
|
||||
|
|
|
@ -191,7 +191,7 @@ class ArchiveMessagesTestingBase(RetentionTestingBase):
|
|||
|
||||
for file_name, path_id, size in dummy_files:
|
||||
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")
|
||||
|
@ -606,7 +606,7 @@ class MoveMessageToArchiveBase(RetentionTestingBase):
|
|||
user_profile = self.example_user("hamlet")
|
||||
for file_name, path_id, size in dummy_files:
|
||||
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:
|
||||
|
|
Loading…
Reference in New Issue