diff --git a/changelog.d/6753.bugfix b/changelog.d/6753.bugfix new file mode 100644 index 000000000..5dfde793e --- /dev/null +++ b/changelog.d/6753.bugfix @@ -0,0 +1 @@ +Fix `AttributeError: 'NoneType' object has no attribute 'get'` in `hash_password` when configuration has an empty `password_config`. Contributed by @ivilata. diff --git a/scripts/hash_password b/scripts/hash_password index a1eb0769d..a30767f75 100755 --- a/scripts/hash_password +++ b/scripts/hash_password @@ -52,7 +52,7 @@ if __name__ == "__main__": if "config" in args and args.config: config = yaml.safe_load(args.config) bcrypt_rounds = config.get("bcrypt_rounds", bcrypt_rounds) - password_config = config.get("password_config", {}) + password_config = config.get("password_config", None) or {} password_pepper = password_config.get("pepper", password_pepper) password = args.password