Forgot to change back the adr of UPDATE sql function to be dynamic to content of online, not a static value. Also removed conn.commit for function where only selects, not update or add.

This commit is contained in:
2017-02-10 16:42:35 +01:00
parent cce64669f2
commit b61ae873f1

View File

@@ -34,7 +34,6 @@ def getTimes():
for name, time in c.fetchall():
returnList.append({"name": name, "time": convertTime(time)})
conn.commit()
conn.close()
return returnList
@@ -66,7 +65,7 @@ def updateTimes():
online = list(set(getOnlineClients()) & set(getAddr(c)))
for adr in online:
c.execute('UPDATE lastonline SET timesince='+ str(curTime) +' WHERE clientadr="cc:29:f5:b8:2d:a2"')
c.execute('UPDATE lastonline SET timesince='+ str(curTime) +' WHERE clientadr="'+ adr + '"')
conn.commit()
conn.close()