From 40f109fffe5ecbf61e068ad2b4a0ad1710a2ce31 Mon Sep 17 00:00:00 2001 From: Selwin Ong Date: Sat, 12 Oct 2024 11:40:09 +0700 Subject: [PATCH] Failed job registry should show jobs in reverse chronological order. --- django_rq/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/django_rq/views.py b/django_rq/views.py index ab9f7485..035a601f 100644 --- a/django_rq/views.py +++ b/django_rq/views.py @@ -134,7 +134,7 @@ def failed_jobs(request, queue_index): last_page = int(ceil(num_jobs / items_per_page)) page_range = list(range(1, last_page + 1)) offset = items_per_page * (page - 1) - job_ids = registry.get_job_ids(offset, offset + items_per_page - 1) + job_ids = registry.get_job_ids(offset, offset + items_per_page - 1, desc=True) jobs = get_jobs(queue, job_ids, registry) else: @@ -536,7 +536,6 @@ def actions(request, queue_index): requeue_job(job_id, connection=queue.connection, serializer=queue.serializer) messages.info(request, 'You have successfully requeued %d jobs!' % len(job_ids)) elif request.POST['action'] == 'stop': - print('stop') stopped, failed_to_stop = stop_jobs(queue, job_ids) if len(stopped) > 0: messages.info(request, 'You have successfully stopped %d jobs!' % len(stopped))