瀏覽代碼

Merge pull request #11505 from AfshanKhan/fix-backup-attribute

fix: Deprecate site_config_backup_path in BackupGenerator
version-14
mergify[bot] 4 年之前
committed by GitHub
父節點
當前提交
aa9a5b9ef2
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 4 個文件被更改,包括 10 次插入4 次删除
  1. +1
    -1
      frappe/integrations/doctype/dropbox_settings/dropbox_settings.py
  2. +1
    -1
      frappe/integrations/doctype/google_drive/google_drive.py
  3. +1
    -1
      frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py
  4. +7
    -1
      frappe/utils/backups.py

+ 1
- 1
frappe/integrations/doctype/dropbox_settings/dropbox_settings.py 查看文件

@@ -97,7 +97,7 @@ def backup_to_dropbox(upload_db_backup=True):
if frappe.flags.create_new_backup:
backup = new_backup(ignore_files=True)
filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_db))
site_config = os.path.join(get_backups_path(), os.path.basename(backup.site_config_backup_path))
site_config = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_conf))
else:
filename, site_config = get_latest_backup_file()



+ 1
- 1
frappe/integrations/doctype/google_drive/google_drive.py 查看文件

@@ -191,7 +191,7 @@ def upload_system_backup_to_google_drive():
backup = new_backup()
file_urls = []
file_urls.append(backup.backup_path_db)
file_urls.append(backup.site_config_backup_path)
file_urls.append(backup.backup_path_conf)

if account.file_backup:
file_urls.append(backup.backup_path_files)


+ 1
- 1
frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py 查看文件

@@ -118,7 +118,7 @@ def backup_to_s3():
backup = new_backup(ignore_files=False, backup_path_db=None,
backup_path_files=None, backup_path_private_files=None, force=True)
db_filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_db))
site_config = os.path.join(get_backups_path(), os.path.basename(backup.site_config_backup_path))
site_config = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_conf))
if backup_files:
files_filename = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_files))
private_files = os.path.join(get_backups_path(), os.path.basename(backup.backup_path_private_files))


+ 7
- 1
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


Loading…
取消
儲存