From: Elrond Date: Mon, 13 Feb 2012 22:11:49 +0000 (+0100) Subject: 47: Only lowercase host part of email X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=53280164e2ebb5856a6f25d14f27439855f99dbb;p=mediagoblin.git 47: Only lowercase host part of email According to most documentation it seems that the local part of an email adress is/can be case sensitive. While the host part is not. So we lowercase only the host part of the given adress. See: http://issues.mediagoblin.org/ticket/47 --- diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py index 9af89c2a..e18469b9 100644 --- a/mediagoblin/auth/views.py +++ b/mediagoblin/auth/views.py @@ -60,7 +60,9 @@ def register(request): if request.method == 'POST' and register_form.validate(): # TODO: Make sure the user doesn't exist already username = unicode(request.POST['username'].lower()) - email = unicode(request.POST['email'].lower()) + em_user, em_dom = unicode(request.POST['email']).split("@", 1) + em_dom = em_dom.lower() + email = em_user + "@" + em_dom users_with_username = request.db.User.find( {'username': username}).count() users_with_email = request.db.User.find(