mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-23 02:27:05 +00:00
Tidy up
This commit is contained in:
parent
803d73cb4e
commit
ef4cb6c465
@ -462,12 +462,12 @@ def list_target_files(config):
|
|||||||
info = InMemoryAccountInfo()
|
info = InMemoryAccountInfo()
|
||||||
b2_api = B2Api(info)
|
b2_api = B2Api(info)
|
||||||
|
|
||||||
escaped_url = urllib.parse.unquote(target.netloc)
|
unquoted_url = urllib.parse.unquote(target.netloc)
|
||||||
|
|
||||||
# Extract information from escaped_url
|
# Extract information from unquoted_url
|
||||||
b2_application_keyid = escaped_url[:escaped_url.index(':')]
|
b2_application_keyid = unquoted_url[:unquoted_url.index(':')]
|
||||||
b2_application_key = escaped_url[escaped_url.index(':')+1:escaped_url.index('@')]
|
b2_application_key = unquoted_url[unquoted_url.index(':')+1:unquoted_url.index('@')]
|
||||||
b2_bucket = escaped_url[escaped_url.index('@')+1:]
|
b2_bucket = unquoted_url[unquoted_url.index('@')+1:]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
b2_api.authorize_account("production", b2_application_keyid, b2_application_key)
|
b2_api.authorize_account("production", b2_application_keyid, b2_application_key)
|
||||||
@ -541,7 +541,7 @@ def get_backup_config(env, for_save=False, for_ui=False):
|
|||||||
|
|
||||||
if config["target"].startswith('b2://'):
|
if config["target"].startswith('b2://'):
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
# unquote the URL.
|
# unquote the URL for the admin
|
||||||
config["target"] = urllib.parse.unquote(config["target"])
|
config["target"] = urllib.parse.unquote(config["target"])
|
||||||
|
|
||||||
# helper fields for the admin
|
# helper fields for the admin
|
||||||
|
Loading…
Reference in New Issue
Block a user