aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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