Skip to content

Commit

Permalink
Merge pull request #566 from CodeForPhilly/565-fix_last_runs
Browse files Browse the repository at this point in the history
Fix 500 error if no previous runs  #565
  • Loading branch information
c-simpson authored Aug 8, 2023
2 parents 56a087d + 789ac17 commit ba3e9f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/server/api/admin_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ def get_run_logs():
with engine.connect() as connection:
q = text("""select keycol,valcol from kv_unique where keycol like '%_update'; """)
result = connection.execute(q)
row_list = []

if result.rowcount > 0:
rows = result.fetchall()

row_list = []
if result.rowcount > 0:
rows = result.fetchall()

for row in rows:
row_dict = row._mapping
row_list.append({row_dict['keycol'] : row_dict['valcol']})
for row in rows:
row_dict = row._mapping
row_list.append({row_dict['keycol'] : row_dict['valcol']})

return jsonify(row_list)

Expand Down

0 comments on commit ba3e9f4

Please sign in to comment.