settings: Show error or success message when deleting uploaded files.

Fixes #6519
This commit is contained in:
Vishnu Ks
2017-09-20 02:43:52 +05:30
committed by Tim Abbott
parent 8faa9ab214
commit 17cc32f168
4 changed files with 24 additions and 2 deletions

View File

@@ -24,5 +24,8 @@ def access_attachment_by_id(user_profile, attachment_id, needs_owner=False):
def remove_attachment(user_profile, attachment):
# type: (UserProfile, Attachment) -> None
delete_message_image(attachment.path_id)
try:
delete_message_image(attachment.path_id)
except Exception:
raise JsonableError(_("An error occured while deleting the attachment. Please try again later."))
attachment.delete()