aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/auth/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/auth/tools.py')
-rw-r--r--mediagoblin/auth/tools.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/mediagoblin/auth/tools.py b/mediagoblin/auth/tools.py
index ae6fadf6..0312cc8f 100644
--- a/mediagoblin/auth/tools.py
+++ b/mediagoblin/auth/tools.py
@@ -47,12 +47,12 @@ def normalize_user_or_email_field(allow_email=True, allow_user=True,
If is_login is True, does not check the length of username.
"""
- message = _(u'Invalid User name or email address.')
- nomail_msg = _(u"This field does not take email addresses.")
- nouser_msg = _(u"This field requires an email address.")
+ message = _('Invalid User name or email address.')
+ nomail_msg = _("This field does not take email addresses.")
+ nouser_msg = _("This field requires an email address.")
def _normalize_field(form, field):
- email = u'@' in field.data
+ email = '@' in field.data
if email: # normalize email address casing
if not allow_email:
raise wtforms.ValidationError(nomail_msg)
@@ -71,8 +71,8 @@ def normalize_user_or_email_field(allow_email=True, allow_user=True,
EMAIL_VERIFICATION_TEMPLATE = (
- u"{uri}?"
- u"token={verification_key}")
+ "{uri}?"
+ "token={verification_key}")
def send_verification_email(user, request, email=None,
@@ -121,11 +121,11 @@ def basic_extra_validation(register_form, *args):
if users_with_username:
register_form.username.errors.append(
- _(u'Sorry, a user with that name already exists.'))
+ _('Sorry, a user with that name already exists.'))
extra_validation_passes = False
if users_with_email:
register_form.email.errors.append(
- _(u'Sorry, a user with that email address already exists.'))
+ _('Sorry, a user with that email address already exists.'))
extra_validation_passes = False
return extra_validation_passes
@@ -144,7 +144,7 @@ def register_user(request, register_form):
user.save()
# log the user in
- request.session['user_id'] = six.text_type(user.id)
+ request.session['user_id'] = str(user.id)
request.session.save()
# send verification email