set username default server-side
authorJakob Kramer <jakob.kramer@gmx.de>
Sun, 25 Mar 2012 19:51:09 +0000 (21:51 +0200)
committerJakob Kramer <jakob.kramer@gmx.de>
Sun, 25 Mar 2012 19:51:09 +0000 (21:51 +0200)
mediagoblin/auth/views.py
mediagoblin/static/js/autofilledin_password.js
mediagoblin/templates/mediagoblin/auth/forgot_password.html

index 46c937b09b61d7874f47f817afa6c5160123440c..71a5f3792d1ecf17989b076b4e156b1fc97a971c 100644 (file)
@@ -236,7 +236,8 @@ def forgot_password(request):
 
     Sends an email with an url to renew forgotten password
     """
-    fp_form = auth_forms.ForgotPassForm(request.POST)
+    fp_form = auth_forms.ForgotPassForm(request.POST,
+                                        username=request.GET.get('username'))
 
     if request.method == 'POST' and fp_form.validate():
 
index 9513c2731a173306aadbcb6c1834287d067c4065..45e867fe9298e83a561765b6373fb1682b82e472 100644 (file)
@@ -22,6 +22,4 @@ $(document).ready(function(){
     window.location.pathname = $(this).attr('href') + '?username=' +
                                $('#username').val();
   });
-
-  $('#username').val(window.location.search.match(/username=(.*)/)[1]);
 });
index 435b63e184047e03548d0231b8536dbc761bedb5..672e9d9a9daf5506a268761282e7c84ce45634b6 100644 (file)
 
 {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
 
-{% block mediagoblin_head %}
-  <script type="text/javascript"
-          src="{{ request.staticdirect('/js/autofilledin_password.js') }}"></script>
-{% endblock %}
-
 {% block mediagoblin_content %}
   <form action="{{ request.urlgen('mediagoblin.auth.forgot_password') }}"
         method="POST" enctype="multipart/form-data">