aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Kramer <jakob.kramer@gmx.de>2012-03-25 21:51:09 +0200
committerJakob Kramer <jakob.kramer@gmx.de>2012-03-25 21:51:09 +0200
commit952b97d5a0671e1b4a68692a3b5f8a696cd2ca5f (patch)
tree8cae02f60d698edab19a5dc156bf9024174d216a
parent6c49799deb6bf776d3765febeb9d7959e27af43d (diff)
downloadmediagoblin-952b97d5a0671e1b4a68692a3b5f8a696cd2ca5f.tar.lz
mediagoblin-952b97d5a0671e1b4a68692a3b5f8a696cd2ca5f.tar.xz
mediagoblin-952b97d5a0671e1b4a68692a3b5f8a696cd2ca5f.zip
set username default server-side
-rw-r--r--mediagoblin/auth/views.py3
-rw-r--r--mediagoblin/static/js/autofilledin_password.js2
-rw-r--r--mediagoblin/templates/mediagoblin/auth/forgot_password.html5
3 files changed, 2 insertions, 8 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
index 46c937b0..71a5f379 100644
--- a/mediagoblin/auth/views.py
+++ b/mediagoblin/auth/views.py
@@ -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():
diff --git a/mediagoblin/static/js/autofilledin_password.js b/mediagoblin/static/js/autofilledin_password.js
index 9513c273..45e867fe 100644
--- a/mediagoblin/static/js/autofilledin_password.js
+++ b/mediagoblin/static/js/autofilledin_password.js
@@ -22,6 +22,4 @@ $(document).ready(function(){
window.location.pathname = $(this).attr('href') + '?username=' +
$('#username').val();
});
-
- $('#username').val(window.location.search.match(/username=(.*)/)[1]);
});
diff --git a/mediagoblin/templates/mediagoblin/auth/forgot_password.html b/mediagoblin/templates/mediagoblin/auth/forgot_password.html
index 435b63e1..672e9d9a 100644
--- a/mediagoblin/templates/mediagoblin/auth/forgot_password.html
+++ b/mediagoblin/templates/mediagoblin/auth/forgot_password.html
@@ -19,11 +19,6 @@
{% 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">