update app_auto_back backupfile route

This commit is contained in:
Chill
2024-06-07 10:47:20 +08:00
parent afb6535d02
commit 654b308285
3 changed files with 4 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
{ {
'name': "Database auto backup,数据库自动备份", 'name': "Database auto backup,数据库自动备份",
'version': '16.24.05.22', 'version': '16.24.06.07',
'summary': 'Automated backups, optimized from auto_backup of Yenthe Van Ginneken', 'summary': 'Automated backups, optimized from auto_backup of Yenthe Van Ginneken',

View File

@@ -12,8 +12,9 @@ _logger = logging.getLogger(__name__)
class AppAutoBackup(http.Controller): class AppAutoBackup(http.Controller):
@http.route("/download/backupfile/<path:file_path>", type="http", auth="user") @http.route("/dbbackup/download/<path:file_path>", type="http", auth="user")
def download_backupfile(self, file_path, **kw): def download_backupfile(self, file_path, **kw):
_logger.warning('download_backupfile: %s', file_path)
if os.path.exists(file_path): if os.path.exists(file_path):
try: try:
with open(file_path, 'rb') as file: with open(file_path, 'rb') as file:

View File

@@ -140,7 +140,7 @@ class DbBackup(models.Model):
rec.backup_details_ids.create({ rec.backup_details_ids.create({
'name': bkp_file, 'name': bkp_file,
'file_path': file_path, 'file_path': file_path,
'url': '/download/backupfile/%s' % file_path, 'url': '/dbbackup/download%s' % file_path,
'db_backup_id': rec.id, 'db_backup_id': rec.id,
}) })
except Exception as error: except Exception as error: