Making the users_with_username function call in the register view slightly cleaner
authorChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 12 Aug 2011 01:15:55 +0000 (20:15 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 12 Aug 2011 01:15:55 +0000 (20:15 -0500)
mediagoblin/auth/views.py

index 121a8c8e0783840fa49e032d59035353042952c0..dc90173e4866f42a011fe72bfe92dcd7a0586db4 100644 (file)
@@ -45,10 +45,8 @@ def register(request):
     if request.method == 'POST' and register_form.validate():
         # TODO: Make sure the user doesn't exist already
 
-        users_with_username = \
-            request.db.User.find({
-                'username': request.POST['username'].lower()
-            }).count()
+        users_with_username = request.db.User.find(
+            {'username': request.POST['username'].lower()}).count()
 
         if users_with_username:
             register_form.username.errors.append(