From bbdb05378b326d3112d3e7e6fddea33333df7ed7 Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Tue, 15 Sep 2020 17:30:26 +0530 Subject: [PATCH] fix: Deprecate site_config_backup_path in favour of backup_path_conf --- frappe/utils/backups.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frappe/utils/backups.py b/frappe/utils/backups.py index 3277ef4c47..7f06a26ee0 100644 --- a/frappe/utils/backups.py +++ b/frappe/utils/backups.py @@ -68,6 +68,12 @@ class BackupGenerator: dir = os.path.dirname(file_path) os.makedirs(dir, exist_ok=True) + @property + def site_config_backup_path(self): + # For backwards compatibility + import click + click.secho("BackupGenerator.site_config_backup_path has been deprecated in favour of BackupGenerator.backup_path_conf", fg="yellow") + return getattr(self, "backup_path_conf", None) def get_backup(self, older_than=24, ignore_files=False, force=False): """ @@ -96,7 +102,7 @@ class BackupGenerator: self.backup_path_files = last_file self.backup_path_db = last_db self.backup_path_private_files = last_private_file - self.site_config_backup_path = site_config_backup_path + self.backup_path_conf = site_config_backup_path def set_backup_file_name(self): #Generate a random name using today's date and a 8 digit random number @@ -176,8 +182,6 @@ class BackupGenerator: with open(site_config_backup_path, "w") as n, open(site_config_path) as c: n.write(c.read()) - self.site_config_backup_path = site_config_backup_path - def take_dump(self): import frappe.utils