formatting changes

pull/4/head
Blake DeMarcy 2017-03-05 18:03:58 -06:00
parent b77a3a3332
commit af7a67951d
1 changed files with 18 additions and 5 deletions

View File

@ -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