avatar -> quip
parent
d23c98e5e7
commit
ed34281a9b
|
@ -86,12 +86,12 @@ def user_resolve(name_or_id):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def user_register(auth_hash, name, avatar, bio):
|
def user_register(auth_hash, name, quip, bio):
|
||||||
if USERDB["mapname"].get(name):
|
if USERDB["mapname"].get(name):
|
||||||
return schema.error(4, "Username taken.")
|
return schema.error(4, "Username taken.")
|
||||||
|
|
||||||
ID = uuid1().hex
|
ID = uuid1().hex
|
||||||
scheme = schema.user_internal(ID, auth_hash, name, avatar, bio, False)
|
scheme = schema.user_internal(ID, auth_hash, name, quip, bio, False)
|
||||||
USERDB.update({ID: scheme})
|
USERDB.update({ID: scheme})
|
||||||
USERDB["mapname"].update({name: ID})
|
USERDB["mapname"].update({name: ID})
|
||||||
user_dbdump(USERDB)
|
user_dbdump(USERDB)
|
||||||
|
@ -101,7 +101,7 @@ def user_register(auth_hash, name, avatar, bio):
|
||||||
def user_get(ID):
|
def user_get(ID):
|
||||||
user = USERDB[ID]
|
user = USERDB[ID]
|
||||||
return schema.user_external(
|
return schema.user_external(
|
||||||
ID, user["name"], user["avatar"],
|
ID, user["name"], user["quip"],
|
||||||
user["bio"], user["admin"])
|
user["bio"], user["admin"])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ endpoints = {
|
||||||
"thread_index": [],
|
"thread_index": [],
|
||||||
"thread_create": ["title", "body", "tags"],
|
"thread_create": ["title", "body", "tags"],
|
||||||
"thread_reply": ["thread_id", "body"],
|
"thread_reply": ["thread_id", "body"],
|
||||||
"user_register": ["user", "auth_hash", "avatar", "bio"],
|
"user_register": ["user", "auth_hash", "quip", "bio"],
|
||||||
"user_get": ["target_user"],
|
"user_get": ["target_user"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ def user_register(json):
|
||||||
db.user_register(
|
db.user_register(
|
||||||
json["auth_hash"],
|
json["auth_hash"],
|
||||||
json["user"],
|
json["user"],
|
||||||
json["avatar"],
|
json["quip"],
|
||||||
json["bio"]))
|
json["bio"]))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,10 @@ def error(code, description):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def user_internal(ID, auth_hash, name, avatar, bio, admin):
|
def user_internal(ID, auth_hash, name, quip, bio, admin):
|
||||||
return {
|
return {
|
||||||
"user_id": ID,
|
"user_id": ID,
|
||||||
"avatar": avatar,
|
"quip": quip,
|
||||||
"name": name,
|
"name": name,
|
||||||
"bio": bio,
|
"bio": bio,
|
||||||
"admin": admin,
|
"admin": admin,
|
||||||
|
@ -37,10 +37,10 @@ def user_internal(ID, auth_hash, name, avatar, bio, admin):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def user_external(ID, name, avatar, bio, admin):
|
def user_external(ID, name, quip, bio, admin):
|
||||||
return {
|
return {
|
||||||
"user_id": ID,
|
"user_id": ID,
|
||||||
"avatar": avatar,
|
"quip": quip,
|
||||||
"name": name,
|
"name": name,
|
||||||
"bio": bio,
|
"bio": bio,
|
||||||
"admin": admin
|
"admin": admin
|
||||||
|
|
Loading…
Reference in New Issue