1
0

Avoid attribute error when password_config present but empty (#6753)

* commit '837f62266':
  Avoid attribute error when `password_config` present but empty (#6753)
This commit is contained in:
Andrew Morgan
2020-03-23 11:38:43 +00:00
2 changed files with 2 additions and 1 deletions

1
changelog.d/6753.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix `AttributeError: 'NoneType' object has no attribute 'get'` in `hash_password` when configuration has an empty `password_config`. Contributed by @ivilata.

View File

@@ -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