aboutsummaryrefslogtreecommitdiffstats
path: root/src/db.py
diff options
context:
space:
mode:
authorBlake DeMarcy <ofunknowndescent@gmail.com>2017-03-03 17:03:16 -0600
committerBlake DeMarcy <ofunknowndescent@gmail.com>2017-03-03 17:03:16 -0600
commit53961bbece1f4d24674ba2fc706c8525243df624 (patch)
treeabdba1b3d332e8a04c22839a62956dc295dc6124 /src/db.py
parente892d20e18a5a7002071f7ec0468437227e508a7 (diff)
downloadbbj-53961bbece1f4d24674ba2fc706c8525243df624.tar.gz
(slightly) less primitive message editing support
Diffstat (limited to 'src/db.py')
-rw-r--r--src/db.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/db.py b/src/db.py
index 0eb38d7..0cbaf5a 100644
--- a/src/db.py
+++ b/src/db.py
@@ -190,7 +190,12 @@ def user_namecheck(name):
return False, schema.error(4,
"Username cannot contain whitespace chars besides spaces.")
- elif len(username) > 24:
+ elif not name.strip():
+ return False, schema.error(4,
+ "Username must contain at least one non-space character")
+
+
+ elif len(name) > 24:
return False, schema.error(4,
"Username is too long (max 24 chars)")
@@ -199,7 +204,7 @@ def user_namecheck(name):
def user_authcheck(auth_hash):
if not auth_hash:
- return schema.error(3,
+ return False, schema.error(3,
"auth_hash may not be empty")
elif len(auth_hash) != 64:
@@ -211,7 +216,7 @@ def user_authcheck(auth_hash):
def user_quipcheck(quip):
if not quip:
- return ""
+ return True, True
elif contains_nonspaces(quip):
return False, schema.error(4,
@@ -226,7 +231,7 @@ def user_quipcheck(quip):
def user_biocheck(bio):
if not bio:
- return ""
+ return True, True
elif len(bio) > 4096:
return False, schema.error(4,
Un proyecto texto-plano.xyz