From 5aded07843b103f13797556e9c0ecbbab85d4a96 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 42621820..d06a6c8a 100755 --- a/management/backup.py +++ b/management/backup.py @@ -600,8 +600,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')