From cb7c0e653cbdf3e48cfd3686e19076d38b276519 Mon Sep 17 00:00:00 2001 From: Akhil Narang Date: Thu, 26 Oct 2023 15:35:16 +0530 Subject: [PATCH] fix(Backup): automatically rollback decryption when object is being deleted This allows us to not have to call it everytime before returning Signed-off-by: Akhil Narang --- frappe/utils/backups.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/utils/backups.py b/frappe/utils/backups.py index 48aa060377..ba546801e5 100644 --- a/frappe/utils/backups.py +++ b/frappe/utils/backups.py @@ -670,6 +670,9 @@ class Backup: os.remove(self.file_path.rstrip(".gz")) os.rename(self.file_path + ".gpg", self.file_path) + def __del__(self): + self.decryption_rollback() + def backup( with_files=False,