set username default server-side

This commit is contained in:
Jakob Kramer 2012-03-25 21:51:09 +02:00
parent 6c49799deb
commit 952b97d5a0
3 changed files with 2 additions and 8 deletions

View File

@ -236,7 +236,8 @@ def forgot_password(request):
Sends an email with an url to renew forgotten password 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(): if request.method == 'POST' and fp_form.validate():

View File

@ -22,6 +22,4 @@ $(document).ready(function(){
window.location.pathname = $(this).attr('href') + '?username=' + window.location.pathname = $(this).attr('href') + '?username=' +
$('#username').val(); $('#username').val();
}); });
$('#username').val(window.location.search.match(/username=(.*)/)[1]);
}); });

View File

@ -19,11 +19,6 @@
{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} {% 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 %} {% block mediagoblin_content %}
<form action="{{ request.urlgen('mediagoblin.auth.forgot_password') }}" <form action="{{ request.urlgen('mediagoblin.auth.forgot_password') }}"
method="POST" enctype="multipart/form-data"> method="POST" enctype="multipart/form-data">