aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/auth
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/auth')
-rw-r--r--mediagoblin/auth/forms.py4
-rw-r--r--mediagoblin/auth/lib.py1
-rw-r--r--mediagoblin/auth/views.py3
3 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/auth/forms.py b/mediagoblin/auth/forms.py
index 1b3e214c..0b2bf959 100644
--- a/mediagoblin/auth/forms.py
+++ b/mediagoblin/auth/forms.py
@@ -48,14 +48,14 @@ class LoginForm(wtforms.Form):
class ForgotPassForm(wtforms.Form):
username = wtforms.TextField(
- 'Username or email',
+ _('Username or email'),
[wtforms.validators.Required()])
def validate_username(form, field):
if not (re.match(r'^\w+$', field.data) or
re.match(r'^.+@[^.].*\.[a-z]{2,10}$', field.data,
re.IGNORECASE)):
- raise wtforms.ValidationError(u'Incorrect input')
+ raise wtforms.ValidationError(_(u'Incorrect input'))
class ChangePassForm(wtforms.Form):
diff --git a/mediagoblin/auth/lib.py b/mediagoblin/auth/lib.py
index ddb58fe6..c5b046d2 100644
--- a/mediagoblin/auth/lib.py
+++ b/mediagoblin/auth/lib.py
@@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import os
import random
import bcrypt
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():