fix sql syntax error

This commit is contained in:
forest 2021-12-09 17:39:40 -06:00
parent 9ce4792cdb
commit 37babae903

View File

@ -435,7 +435,7 @@ class DBModel:
self.connection.commit()
def host_by_id(self, host_id: str) -> OnlineHost:
self.cursor.execute("SELECT hosts.id, hosts.https_url FROM hosts hosts.id = %s", (host_id,))
self.cursor.execute("SELECT hosts.id, hosts.https_url FROM hosts WHERE hosts.id = %s", (host_id,))
row = self.cursor.fetchone()
if row:
return OnlineHost(row[0], row[1])