mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
upload: Rename delete_message_image to use word "attachment".
The table is named Attachment, and not all of them are images.
This commit is contained in:
committed by
Tim Abbott
parent
567d1d54e7
commit
bd80c048be
@@ -3,7 +3,7 @@ from typing import Any, Dict, List
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from zerver.lib.exceptions import JsonableError
|
||||
from zerver.lib.upload import delete_message_image
|
||||
from zerver.lib.upload import delete_message_attachment
|
||||
from zerver.models import Attachment, UserProfile
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ def access_attachment_by_id(
|
||||
|
||||
def remove_attachment(user_profile: UserProfile, attachment: Attachment) -> None:
|
||||
try:
|
||||
delete_message_image(attachment.path_id)
|
||||
delete_message_attachment(attachment.path_id)
|
||||
except Exception:
|
||||
raise JsonableError(
|
||||
_("An error occurred while deleting the attachment. Please try again later.")
|
||||
|
||||
Reference in New Issue
Block a user