Skip to content
Snippets Groups Projects
Verified Commit 5de4ca01 authored by David Hoese's avatar David Hoese
Browse files

Fix layer times for postgres using the wrong column name

parent 47ab7762
No related branches found
No related tags found
No related merge requests found
Pipeline #19110 failed
...@@ -33,7 +33,7 @@ try: ...@@ -33,7 +33,7 @@ try:
conn = psycopg2.connect(connect_str) conn = psycopg2.connect(connect_str)
with conn: with conn:
with conn.cursor() as cur: with conn.cursor() as cur:
cur.execute(sql.SQL("SELECT time FROM {}").format(sql.Identifier(table_name))) cur.execute(sql.SQL("SELECT start_time FROM {}").format(sql.Identifier(table_name)))
times = cur.fetchall() times = cur.fetchall()
except psycopg2.errors.DataBaseError: except psycopg2.errors.DataBaseError:
print("""Status: 500 Database Error print("""Status: 500 Database Error
...@@ -44,6 +44,8 @@ Error requesting time information from database. ...@@ -44,6 +44,8 @@ Error requesting time information from database.
""") """)
sys.exit(1) sys.exit(1)
# postgres returned a list of tuples
times = [time_tuple[0] for time_tuple in times]
print("Content-Type: application/json") print("Content-Type: application/json")
print("Access-Control-Allow-Origin: *") print("Access-Control-Allow-Origin: *")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment