aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/basic_auth
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/plugins/basic_auth')
-rw-r--r--mediagoblin/plugins/basic_auth/tools.py10
-rw-r--r--mediagoblin/plugins/basic_auth/views.py4
2 files changed, 7 insertions, 7 deletions
diff --git a/mediagoblin/plugins/basic_auth/tools.py b/mediagoblin/plugins/basic_auth/tools.py
index 13f240b2..ad3cb1b0 100644
--- a/mediagoblin/plugins/basic_auth/tools.py
+++ b/mediagoblin/plugins/basic_auth/tools.py
@@ -40,7 +40,7 @@ def bcrypt_check_password(raw_pass, stored_hash, extra_salt=None):
True or False depending on success.
"""
if extra_salt:
- raw_pass = u"%s:%s" % (extra_salt, raw_pass)
+ raw_pass = "{}:{}".format(extra_salt, raw_pass)
hashed_pass = bcrypt.hashpw(raw_pass.encode('utf-8'), stored_hash)
@@ -66,9 +66,9 @@ def bcrypt_gen_password_hash(raw_pass, extra_salt=None):
non-database extra salt
"""
if extra_salt:
- raw_pass = u"%s:%s" % (extra_salt, raw_pass)
+ raw_pass = "{}:{}".format(extra_salt, raw_pass)
- return six.text_type(
+ return str(
bcrypt.hashpw(raw_pass.encode('utf-8'), bcrypt.gensalt()))
@@ -92,8 +92,8 @@ def fake_login_attempt():
EMAIL_FP_VERIFICATION_TEMPLATE = (
- u"{uri}?"
- u"token={fp_verification_key}")
+ "{uri}?"
+ "token={fp_verification_key}")
def send_fp_verification_email(user, request):
diff --git a/mediagoblin/plugins/basic_auth/views.py b/mediagoblin/plugins/basic_auth/views.py
index f398f0d2..9433b22d 100644
--- a/mediagoblin/plugins/basic_auth/views.py
+++ b/mediagoblin/plugins/basic_auth/views.py
@@ -70,7 +70,7 @@ def forgot_password(request):
success_message = _("An email has been sent with instructions "
"on how to change your password.")
- if user and user.has_privilege(u'active') is False:
+ if user and user.has_privilege('active') is False:
# Don't send reminder because user is inactive or has no verified email
messages.add_message(
request,
@@ -128,7 +128,7 @@ def verify_forgot_password(request):
request, 'index')
# check if user active and has email verified
- if user.has_privilege(u'active'):
+ if user.has_privilege('active'):
cp_form = forms.ChangeForgotPassForm(formdata_vars)
if request.method == 'POST' and cp_form.validate():