From b6b667a9c377a133528b05fe03a394eb48e25f04 Mon Sep 17 00:00:00 2001 From: Corentin Forler <10946971+cogk@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:25:05 +0100 Subject: [PATCH] fix(RemoteFile): Don't try to delete unavailable S3 file --- press/press/doctype/remote_file/remote_file.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/press/press/doctype/remote_file/remote_file.py b/press/press/doctype/remote_file/remote_file.py index fd17d32b13..b00ce85730 100644 --- a/press/press/doctype/remote_file/remote_file.py +++ b/press/press/doctype/remote_file/remote_file.py @@ -231,7 +231,8 @@ def delete_remote_object(self): ) def on_trash(self): - self.delete_remote_object() + if self.status != "Unavailable": + self.delete_remote_object() @frappe.whitelist() def get_download_link(self):