diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-12-23 23:49:49 +0000 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-12-23 23:54:20 +0000 |
commit | 50889ccca57cea9166ab7c64a83d540d6c0a20ce (patch) | |
tree | 57d757bc7250517b8f4b5e38251b9dfc8422bf8c /app/utils.py | |
parent | b8ca5d24c50f108ea574c89405e2ce2e70ea18af (diff) | |
download | cheatdb-50889ccca57cea9166ab7c64a83d540d6c0a20ce.tar.xz |
Add topic searching and topic discarding
Diffstat (limited to 'app/utils.py')
-rw-r--r-- | app/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/utils.py b/app/utils.py index cb6a315..21c7fd6 100644 --- a/app/utils.py +++ b/app/utils.py @@ -68,7 +68,10 @@ def make_flask_user_password(plaintext_str): import bcrypt plaintext = plaintext_str.encode("UTF-8") password = bcrypt.hashpw(plaintext, bcrypt.gensalt()) - return password.decode("UTF-8") + if isinstance(password, str): + return password + else: + return password.decode("UTF-8") def _do_login_user(user, remember_me=False): def _call_or_get(v): |