Skip to content

Commit ba3e9f4

Browse files
authored
Merge pull request #566 from CodeForPhilly/565-fix_last_runs
Fix 500 error if no previous runs #565
2 parents 56a087d + 789ac17 commit ba3e9f4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/server/api/admin_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ def get_run_logs():
239239
with engine.connect() as connection:
240240
q = text("""select keycol,valcol from kv_unique where keycol like '%_update'; """)
241241
result = connection.execute(q)
242+
row_list = []
242243

243-
if result.rowcount > 0:
244-
rows = result.fetchall()
245244

246-
row_list = []
245+
if result.rowcount > 0:
246+
rows = result.fetchall()
247247

248-
for row in rows:
249-
row_dict = row._mapping
250-
row_list.append({row_dict['keycol'] : row_dict['valcol']})
248+
for row in rows:
249+
row_dict = row._mapping
250+
row_list.append({row_dict['keycol'] : row_dict['valcol']})
251251

252252
return jsonify(row_list)
253253

0 commit comments

Comments
 (0)