mirror of
https://github.com/zulip/zulip.git
synced 2026-07-18 21:04:19 +08:00
upload: Fix single attachments not being claimed on message edit.
Fixed an attachments not being claimed if just one new attachment is added (aka the common case).
This commit is contained in:
parent
e06d5fbec9
commit
5ed2b01bc7
@ -3368,5 +3368,5 @@ def check_attachment_reference_change(prev_content, message):
|
||||
pass
|
||||
|
||||
to_add = list(new_attachments - prev_attachments)
|
||||
if len(to_add) > 1:
|
||||
if len(to_add) > 0:
|
||||
do_claim_attachments(message)
|
||||
|
||||
@ -230,7 +230,7 @@ class FileUploadTest(AuthedTestCase):
|
||||
message = Message.objects.get(id=msg_id)
|
||||
f1_attachment = Attachment.objects.get(path_id=f1_path_id)
|
||||
f2_attachment = Attachment.objects.get(path_id=f2_path_id)
|
||||
f3_attachment = Attachment.objects.get(path_id=f2_path_id)
|
||||
f3_attachment = Attachment.objects.get(path_id=f3_path_id)
|
||||
|
||||
self.assertTrue(message not in f1_attachment.messages.all())
|
||||
self.assertTrue(message in f2_attachment.messages.all())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user