From af7a67951dd1f6eac8fea4e3344a142c83791b0c Mon Sep 17 00:00:00 2001 From: Blake DeMarcy Date: Sun, 5 Mar 2017 18:03:58 -0600 Subject: [PATCH] formatting changes --- src/schema.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/schema.py b/src/schema.py index 7f5f545..b0698f4 100644 --- a/src/schema.py +++ b/src/schema.py @@ -28,8 +28,12 @@ def error(code, description): def user_internal(ID, auth_hash, name, quip, bio, admin): - if not quip: quip = "" - if not bio: bio = "" + if not quip: + quip = "" + + if not bio: + bio = "" + return { "user_id": ID, # string "quip": quip, # (possibly empty) string @@ -41,8 +45,12 @@ def user_internal(ID, auth_hash, name, quip, bio, admin): def user_external(ID, name, quip, bio, admin): - if not quip: quip = "" - if not bio: bio = "" + if not quip: + quip = "" + + if not bio: + bio = "" + return { "user_id": ID, # string "quip": quip, # (possibly empty) string @@ -53,9 +61,12 @@ def user_external(ID, name, quip, bio, admin): def thread(ID, author, body, title, tags): - if not tags: tags = list() + if not tags: + tags = list() + body = formatting.parse(body, doquotes=False) now = time() + return { "thread_id": ID, # string "post_id": 1, # integer @@ -72,8 +83,10 @@ def thread(ID, author, body, title, tags): def reply(ID, author, body): + body = formatting.parse(body) now = time() + return { "post_id": ID, # integer "author": author, # string