diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-27 19:31:19 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-27 19:31:19 -0500 |
commit | ef4e07054a743977aab8cecc35366b959938c751 (patch) | |
tree | da23936c08bcd5a217028fa4d77ab1374fc95a43 /src | |
parent | 634a868030b6fc6512d7238b330e1ae265ee1c9d (diff) | |
download | bbj-ef4e07054a743977aab8cecc35366b959938c751.tar.gz |
lowercase all hashes
Diffstat (limited to 'src')
-rw-r--r-- | src/db.py | 4 | ||||
-rw-r--r-- | src/schema.py | 2 |
2 files changed, 4 insertions, 2 deletions
@@ -338,7 +338,7 @@ def user_register(connection, user_name, auth_hash): raise BBJUserError("Username already registered") scheme = schema.user_internal( - uuid1().hex, user_name, auth_hash, + uuid1().hex, user_name, auth_hash.lower(), "", "", 0, False, time()) connection.execute(""" @@ -391,6 +391,8 @@ def user_update(connection, user_object, parameters): # bool(0) == False hur hur hurrrrrr ::drools:: if value == 0 or value: validate([(key, value)]) + if key == "auth_hash": + value = value.lower() user_object[key] = value values = ordered_keys(user_object, diff --git a/src/schema.py b/src/schema.py index aedb765..39c67bf 100644 --- a/src/schema.py +++ b/src/schema.py @@ -83,7 +83,7 @@ def user_internal( return { "user_id": user_id, "user_name": user_name, - "auth_hash": auth_hash, + "auth_hash": auth_hash.lower(), "quip": quip, "bio": bio, "color": color, |