From 58ded74181b750ae654ef8ca19f10527471b5e82 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Mon, 12 Sep 2022 18:13:31 -0400 Subject: [PATCH] Restore the backup S3 host select box if an S3 target has been set Also remove unnecessary import added in 7cda439c. Was a mistake from edits during PR review. --- management/daemon.py | 1 - management/templates/system-backup.html | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/management/daemon.py b/management/daemon.py index 2be32504..dc59c19b 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -122,7 +122,6 @@ def index(): no_admins_exist = (len(get_admins(env)) == 0) import boto3.s3 - from urllib.parse import urlparse backup_s3_hosts = [(r, f"s3.{r}.amazonaws.com") for r in boto3.session.Session().get_available_regions('s3')] diff --git a/management/templates/system-backup.html b/management/templates/system-backup.html index 3075b912..5450b6e5 100644 --- a/management/templates/system-backup.html +++ b/management/templates/system-backup.html @@ -269,6 +269,7 @@ function show_custom_backup() { $("#backup-target-type").val("s3"); var hostpath = r.target.substring(5).split('/'); var host = hostpath.shift(); + $("#backup-target-s3-host-select").val(host); $("#backup-target-s3-host").val(host); $("#backup-target-s3-path").val(hostpath.join('/')); } else if (r.target.substring(0, 5) == "b2://") {