aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/auth/views.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-08-30 20:16:47 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-08-30 20:16:47 -0500
commit2886b340d33c8f5c9cef933089fc1fce525da6aa (patch)
treec0f86bbdb41b33bd97e92f19b751dad898daaa62 /mediagoblin/auth/views.py
parent04a7b06d613dd3ab90cde4eb268087e28d92017c (diff)
parent502073f2bf65380be18b349a678ac075777889a4 (diff)
downloadmediagoblin-2886b340d33c8f5c9cef933089fc1fce525da6aa.tar.lz
mediagoblin-2886b340d33c8f5c9cef933089fc1fce525da6aa.tar.xz
mediagoblin-2886b340d33c8f5c9cef933089fc1fce525da6aa.zip
Merge remote branch 'remotes/jwandborg/f403_ability_to_delete'
Diffstat (limited to 'mediagoblin/auth/views.py')
-rw-r--r--mediagoblin/auth/views.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
index 4c4a34fd..48c5937c 100644
--- a/mediagoblin/auth/views.py
+++ b/mediagoblin/auth/views.py
@@ -44,11 +44,12 @@ 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())
users_with_username = request.db.User.find(
- {'username': request.POST['username'].lower()}).count()
+ {'username': username}).count()
users_with_email = request.db.User.find(
- {'email': request.POST['email'].lower()}).count()
+ {'email': email}).count()
extra_validation_passes = True
@@ -64,8 +65,8 @@ def register(request):
if extra_validation_passes:
# Create the user
user = request.db.User()
- user['username'] = request.POST['username'].lower()
- user['email'] = request.POST['email'].lower()
+ user['username'] = username
+ user['email'] = email
user['pw_hash'] = auth_lib.bcrypt_gen_password_hash(
request.POST['password'])
user.save(validate=True)