fixed some typos and missed imports

This commit is contained in:
Rodney Ewing 2013-07-09 16:52:37 -07:00
parent f66e4282d4
commit 33b5cebe75
3 changed files with 9 additions and 5 deletions

View File

@ -16,6 +16,11 @@
import bcrypt
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):
"""
@ -101,10 +106,10 @@ def send_fp_verification_email(user, request):
.dumps(user.id)
rendered_email = render_template(
request, 'mediagoblin/auth/fp_verification_email.txt',
request, 'mediagoblin/plugins/basic_auth/fp_verification_email.txt',
{'username': user.username,
'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),
fp_verification_key=fp_verification_key)})
@ -114,4 +119,3 @@ def send_fp_verification_email(user, request):
[user.email],
'GNU MediaGoblin - Change forgotten password!',
rendered_email)

View File

@ -127,7 +127,7 @@ def verify_forgot_password(request):
# check if user active and has email verified
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():
user.pw_hash = tools.bcrypt_gen_password_hash(

View File

@ -64,7 +64,7 @@ def test_bcrypt_gen_password_hash():
'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_user = fixture_add_user(password=u'toast')