cleanup after merge
authorRodney Ewing <ewing.rj@gmail.com>
Tue, 25 Jun 2013 20:43:33 +0000 (13:43 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Tue, 25 Jun 2013 20:43:33 +0000 (13:43 -0700)
mediagoblin/auth/forms.py
mediagoblin/auth/tools.py
mediagoblin/edit/views.py

index 866caa13897c0cb67f33bda7e661fb352cd5dc0b..865502e9c1372d3983437eae597553e73ce7dbad 100644 (file)
@@ -29,7 +29,9 @@ class ForgotPassForm(wtforms.Form):
 
 class ChangePassForm(wtforms.Form):
     password = wtforms.PasswordField(
-        'Password')
+        'Password',
+        [wtforms.validators.Required(),
+         wtforms.validators.Length(min=5, max=1024)])
     token = wtforms.HiddenField(
         '',
         [wtforms.validators.Required()])
index 877da14f03e4a22ed29110b27c56e9c46ec53669..f3f92414515fe7a3853b764b80c0e17d02e19eef 100644 (file)
@@ -102,8 +102,8 @@ def send_verification_email(user, request, email=None,
 
 
 EMAIL_FP_VERIFICATION_TEMPLATE = (
-    u"http://{host}{uri}?"
-    u"userid={userid}&token={fp_verification_key}")
+    u"{uri}?"
+    u"token={fp_verification_key}")
 
 
 def send_fp_verification_email(user, request):
@@ -114,14 +114,15 @@ def send_fp_verification_email(user, request):
     - user: a user object
     - request: the request
     """
+    fp_verification_key = get_timed_signer_url('mail_verification_token') \
+            .dumps(user.id)
     rendered_email = render_template(
         request, 'mediagoblin/auth/fp_verification_email.txt',
         {'username': user.username,
          'verification_url': EMAIL_FP_VERIFICATION_TEMPLATE.format(
-                host=request.host,
-                uri=request.urlgen('mediagoblin.auth.verify_forgot_password'),
-                userid=unicode(user.id),
-                fp_verification_key=user.fp_verification_key)})
+             uri=request.urlgen('mediagoblin.auth.verify_forgot_password',
+                                qualified=True),
+             fp_verification_key=fp_verification_key)})
 
     # TODO: There is no error handling in place
     send_email(
index 429eb5849fea51ef606c3aa458b793776d156c09..25a024465ebd3d0056cd3171101045db4368901d 100644 (file)
@@ -24,6 +24,7 @@ from mediagoblin import messages
 from mediagoblin import mg_globals
 
 from mediagoblin import auth
+from mediagoblin.auth import tools as auth_tools
 from mediagoblin.edit import forms
 from mediagoblin.edit.lib import may_edit_media
 from mediagoblin.decorators import (require_active_login, active_user_from_url,