aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-08-11 20:37:21 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-08-11 20:37:21 -0500
commit9f6ea47586f78370c42dc9b45782f398bebf7d2e (patch)
tree199a7399feee56229098d2aa6fc91d99314148e1
parent873e4e9d2da8a3976de6c44838f517cfc314d620 (diff)
downloadmediagoblin-9f6ea47586f78370c42dc9b45782f398bebf7d2e.tar.lz
mediagoblin-9f6ea47586f78370c42dc9b45782f398bebf7d2e.tar.xz
mediagoblin-9f6ea47586f78370c42dc9b45782f398bebf7d2e.zip
If both the username and the email checks fail, warn about both at the same time
-rw-r--r--mediagoblin/auth/views.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
index 91599e47..ce6b5dfc 100644
--- a/mediagoblin/auth/views.py
+++ b/mediagoblin/auth/views.py
@@ -50,14 +50,18 @@ def register(request):
users_with_email = request.db.User.find(
{'email': request.POST['email'].lower()}).count()
+ extra_validation_passes = True
+
if users_with_username:
register_form.username.errors.append(
_(u'Sorry, a user with that name already exists.'))
- elif users_with_email:
+ extra_validation_passes = False
+ if users_with_email:
register_form.email.errors.append(
_(u'Sorry, that email address has already been taken.'))
+ extra_validation_passes = False
- else:
+ if extra_validation_passes:
# Create the user
user = request.db.User()
user['username'] = request.POST['username'].lower()