From: Rodney Ewing Date: Tue, 9 Jul 2013 23:52:37 +0000 (-0700) Subject: fixed some typos and missed imports X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=33b5cebe750a8bc8a96401bd6cda729fa9b00a9d;p=mediagoblin.git fixed some typos and missed imports --- diff --git a/mediagoblin/plugins/basic_auth/tools.py b/mediagoblin/plugins/basic_auth/tools.py index 97393976..f943bf39 100644 --- a/mediagoblin/plugins/basic_auth/tools.py +++ b/mediagoblin/plugins/basic_auth/tools.py @@ -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) - diff --git a/mediagoblin/plugins/basic_auth/views.py b/mediagoblin/plugins/basic_auth/views.py index 9a1b75d2..d0941ae5 100644 --- a/mediagoblin/plugins/basic_auth/views.py +++ b/mediagoblin/plugins/basic_auth/views.py @@ -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( diff --git a/mediagoblin/tests/test_basic_auth.py b/mediagoblin/tests/test_basic_auth.py index e03f90f0..45deab7c 100644 --- a/mediagoblin/tests/test_basic_auth.py +++ b/mediagoblin/tests/test_basic_auth.py @@ -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')