From 1ced86031ec35bcc47b51a80b586518da9acba78 Mon Sep 17 00:00:00 2001 From: Milo Hyben Date: Wed, 29 May 2024 17:17:41 +1000 Subject: [PATCH] One more fix for the SQL, job_groups table have time_completed as well causing Error: Column 'time_completed' in where clause is ambiguous. (#340) --- batch/batch/front_end/front_end.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/batch/batch/front_end/front_end.py b/batch/batch/front_end/front_end.py index b1228c48cc3..bfa5c54ba19 100644 --- a/batch/batch/front_end/front_end.py +++ b/batch/batch/front_end/front_end.py @@ -406,7 +406,7 @@ async def get_completed_batches_ordered_by_completed_time(request, userdata): last_completed_timestamp = request.query.get('last_completed_timestamp') if last_completed_timestamp: where_args.append(int(last_completed_timestamp)) - wheres.append('time_completed < %s') + wheres.append('batches.time_completed < %s') sql = f""" SELECT batches.*, @@ -441,7 +441,7 @@ async def get_completed_batches_ordered_by_completed_time(request, userdata): ) AS cost_t ON TRUE WHERE {' AND '.join(wheres)} -ORDER BY time_completed DESC +ORDER BY batches.time_completed DESC LIMIT %s; """