Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 26213e8

Browse files
committed
add colors to set profile api call
1 parent 8bc6e7d commit 26213e8

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

api/restapi.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ def update_profile(self, request):
289289
if not p.get().encryption_key \
290290
and "name" not in request.args \
291291
and "location" not in request.args:
292-
return "False"
292+
request.write(json.dumps({"success": False, "reason": "name or location not included"}, indent=4))
293+
request.finish()
294+
return False
293295
u = objects.Profile()
294296
if "name" in request.args:
295297
u.name = request.args["name"][0]
@@ -312,6 +314,14 @@ def update_profile(self, request):
312314
u.website = request.args["website"][0]
313315
if "email" in request.args:
314316
u.email = request.args["email"][0]
317+
if "primary_color" in request.args:
318+
u.primary_color = int(request.args["primary_color"][0])
319+
if "secondary_color" in request.args:
320+
u.secondary_color = int(request.args["secondary_color"][0])
321+
if "background_color" in request.args:
322+
u.background_color = int(request.args["background_color"][0])
323+
if "text_color" in request.args:
324+
u.text_color = int(request.args["text_color"][0])
315325
if "avatar" in request.args:
316326
with open(DATA_FOLDER + "store/avatar", 'wb') as outfile:
317327
outfile.write(request.args["avatar"][0])

openbazaard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def run(*args):
5555

5656
# TODO: maintain open connection to seed node if STUN/UPnP fail
5757

58-
# TODO: use TURN of symmetric NAT
58+
# TODO: use TURN if symmetric NAT
5959

6060
def on_bootstrap_complete(resp):
6161
mlistener = MessageListenerImpl(ws_factory, db)

0 commit comments

Comments
 (0)