@@ -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 ])
0 commit comments