probably the final commit

This commit is contained in:
Lynne Megido 2019-02-26 12:32:01 +10:00
parent de87d7761b
commit b0d3dae56d
Signed by: lynnesbian
GPG key ID: FB7B970303ACE499

5
web.py
View file

@ -92,7 +92,10 @@ def home():
#update cc avi too #update cc avi too
r = requests.get("https://curiouscat.me/api/v2/profile?username={}".format(session['cc'])) r = requests.get("https://curiouscat.me/api/v2/profile?username={}".format(session['cc']))
j = r.json() j = r.json()
session['ccavi'] = j['userData']['avatar'] try:
session['ccavi'] = j['userData']['avatar']
except:
return json.dumps(j)
c.execute("UPDATE data SET avi = %s, ccavi = %s WHERE client_id = %s AND instance = %s", (session['avi'], session['ccavi'], session['client_id'], session['instance'])) c.execute("UPDATE data SET avi = %s, ccavi = %s WHERE client_id = %s AND instance = %s", (session['avi'], session['ccavi'], session['client_id'], session['instance']))
else: else:
c.execute("UPDATE data SET avi = %s WHERE client_id = %s AND instance = %s", (session['avi'], session['client_id'], session['instance'])) c.execute("UPDATE data SET avi = %s WHERE client_id = %s AND instance = %s", (session['avi'], session['client_id'], session['instance']))