aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Villanueva <admin@ialex.org>2011-06-14 11:03:56 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-08-11 20:32:55 -0500
commit0bf099d7536b5f5f876fa21e4c72f132b7c757a8 (patch)
treedfb06a31ae1b3f012a6974825dad4c8b01628282
parentdc49cf600aba92331419a3566f768b061b8102e3 (diff)
downloadmediagoblin-0bf099d7536b5f5f876fa21e4c72f132b7c757a8.tar.lz
mediagoblin-0bf099d7536b5f5f876fa21e4c72f132b7c757a8.tar.xz
mediagoblin-0bf099d7536b5f5f876fa21e4c72f132b7c757a8.zip
Checks if the email(lowercase) have been used before to register a user
-rw-r--r--mediagoblin/auth/views.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
index dc90173e..61164be8 100644
--- a/mediagoblin/auth/views.py
+++ b/mediagoblin/auth/views.py
@@ -47,10 +47,15 @@ def register(request):
users_with_username = request.db.User.find(
{'username': request.POST['username'].lower()}).count()
+ users_with_email = request.db.User.find(
+ {'email': request.POST['email'].lower()}).count()
if users_with_username:
register_form.username.errors.append(
_(u'Sorry, a user with that name already exists.'))
+ elif users_with_email:
+ register_form.email.errors.append(
+ _(u'Sorry, that email address has already been taken.'))
else:
# Create the user