From d9d6e96d696df61755e9bc1791e58a2afa35a40f Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Wed, 8 Jan 2025 05:10:30 -0800 Subject: [PATCH] Fixed RUF051 (if-key-in-dict-del): Use `pop` instead of `key in dict` followed by `del dict[key]` --- management/backup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/management/backup.py b/management/backup.py index d9a0f567..2012fa23 100755 --- a/management/backup.py +++ b/management/backup.py @@ -603,8 +603,7 @@ def get_backup_config(env, for_save=False, for_ui=False): # authentication details. The user will have to re-enter it. if for_ui: for field in ("target_user", "target_pass"): - if field in config: - del config[field] + config.pop(field, None) # helper fields for the admin config["file_target_directory"] = os.path.join(backup_root, 'encrypted')