fixed some typos and missed imports
This commit is contained in:
parent
f66e4282d4
commit
33b5cebe75
@ -16,6 +16,11 @@
|
|||||||
import bcrypt
|
import bcrypt
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
from mediagoblin import mg_globals
|
||||||
|
from mediagoblin.tools.crypto import get_timed_signer_url
|
||||||
|
from mediagoblin.tools.mail import send_email
|
||||||
|
from mediagoblin.tools.template import render_template
|
||||||
|
|
||||||
|
|
||||||
def bcrypt_check_password(raw_pass, stored_hash, extra_salt=None):
|
def bcrypt_check_password(raw_pass, stored_hash, extra_salt=None):
|
||||||
"""
|
"""
|
||||||
@ -101,10 +106,10 @@ def send_fp_verification_email(user, request):
|
|||||||
.dumps(user.id)
|
.dumps(user.id)
|
||||||
|
|
||||||
rendered_email = render_template(
|
rendered_email = render_template(
|
||||||
request, 'mediagoblin/auth/fp_verification_email.txt',
|
request, 'mediagoblin/plugins/basic_auth/fp_verification_email.txt',
|
||||||
{'username': user.username,
|
{'username': user.username,
|
||||||
'verification_url': EMAIL_FP_VERIFICATION_TEMPLATE.format(
|
'verification_url': EMAIL_FP_VERIFICATION_TEMPLATE.format(
|
||||||
uri=request.urlgen('mediagoblin.auth.verify_forgot_password',
|
uri=request.urlgen('mediagoblin.plugins.basic_auth.verify_forgot_password',
|
||||||
qualified=True),
|
qualified=True),
|
||||||
fp_verification_key=fp_verification_key)})
|
fp_verification_key=fp_verification_key)})
|
||||||
|
|
||||||
@ -114,4 +119,3 @@ def send_fp_verification_email(user, request):
|
|||||||
[user.email],
|
[user.email],
|
||||||
'GNU MediaGoblin - Change forgotten password!',
|
'GNU MediaGoblin - Change forgotten password!',
|
||||||
rendered_email)
|
rendered_email)
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ def verify_forgot_password(request):
|
|||||||
# check if user active and has email verified
|
# check if user active and has email verified
|
||||||
if user.email_verified and user.status == 'active':
|
if user.email_verified and user.status == 'active':
|
||||||
|
|
||||||
cp_form = forms.ChangePassForm(formdata_vars)
|
cp_form = forms.ChangeForgotPassForm(formdata_vars)
|
||||||
|
|
||||||
if request.method == 'POST' and cp_form.validate():
|
if request.method == 'POST' and cp_form.validate():
|
||||||
user.pw_hash = tools.bcrypt_gen_password_hash(
|
user.pw_hash = tools.bcrypt_gen_password_hash(
|
||||||
|
@ -64,7 +64,7 @@ def test_bcrypt_gen_password_hash():
|
|||||||
'notthepassword', hashed_pw, '3><7R45417')
|
'notthepassword', hashed_pw, '3><7R45417')
|
||||||
|
|
||||||
|
|
||||||
def test_change_password(self, test_app):
|
def test_change_password(test_app):
|
||||||
"""Test changing password correctly and incorrectly"""
|
"""Test changing password correctly and incorrectly"""
|
||||||
test_user = fixture_add_user(password=u'toast')
|
test_user = fixture_add_user(password=u'toast')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user