fixed some typos and missed imports
authorRodney Ewing <ewing.rj@gmail.com>
Tue, 9 Jul 2013 23:52:37 +0000 (16:52 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Fri, 16 Aug 2013 17:28:49 +0000 (10:28 -0700)
mediagoblin/plugins/basic_auth/tools.py
mediagoblin/plugins/basic_auth/views.py
mediagoblin/tests/test_basic_auth.py

index 97393976fcf9444d1ef6d4a103d7d74cbdce0373..f943bf396a5778f99ed698df2dfca923457c51cb 100644 (file)
 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)
-
index 9a1b75d228771175e5d2e67b9871247d01dfabdd..d0941ae5a3cecc06f264f8bc8412a5317c3d0ee1 100644 (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(
index e03f90f05a77feed24acf530ae48a403d722a253..45deab7c5f3bf1754606bceb7b0067f5334d1e40 100644 (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')