diff options
author | Ben Sturmfels <ben@sturm.com.au> | 2021-09-23 11:51:04 +1000 |
---|---|---|
committer | Ben Sturmfels <ben@sturm.com.au> | 2021-09-23 11:51:04 +1000 |
commit | 6f48143f4c60c555b3f571007cdc929ce90920b1 (patch) | |
tree | 2a2333a365379d4c4c42faf79bcd9db20aaa8626 /mediagoblin/plugins/basic_auth/tools.py | |
parent | f90707e22c0380bd0f17e2e724e58ecf91abd5a3 (diff) | |
download | mediagoblin-6f48143f4c60c555b3f571007cdc929ce90920b1.tar.lz mediagoblin-6f48143f4c60c555b3f571007cdc929ce90920b1.tar.xz mediagoblin-6f48143f4c60c555b3f571007cdc929ce90920b1.zip |
Apply pyupgrade --py36-plus.
This removes some 'u' prefixes and converts simple format() calls to f-strings.
Diffstat (limited to 'mediagoblin/plugins/basic_auth/tools.py')
-rw-r--r-- | mediagoblin/plugins/basic_auth/tools.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mediagoblin/plugins/basic_auth/tools.py b/mediagoblin/plugins/basic_auth/tools.py index 3e807297..5b89e51b 100644 --- a/mediagoblin/plugins/basic_auth/tools.py +++ b/mediagoblin/plugins/basic_auth/tools.py @@ -38,7 +38,7 @@ def bcrypt_check_password(raw_pass, stored_hash, extra_salt=None): True or False depending on success. """ if extra_salt: - raw_pass = "{}:{}".format(extra_salt, raw_pass) + raw_pass = f"{extra_salt}:{raw_pass}" hashed_pass = bcrypt.hashpw(raw_pass.encode('utf-8'), stored_hash) @@ -64,7 +64,7 @@ def bcrypt_gen_password_hash(raw_pass, extra_salt=None): non-database extra salt """ if extra_salt: - raw_pass = "{}:{}".format(extra_salt, raw_pass) + raw_pass = f"{extra_salt}:{raw_pass}" return str( bcrypt.hashpw(raw_pass.encode('utf-8'), bcrypt.gensalt())) |