From 2db9580b37b2b304f41417b1ef0f8cb29d373e6d Mon Sep 17 00:00:00 2001 From: Bernard Fazzini <89023714+bernardfazziniais@users.noreply.github.com> Date: Thu, 30 Dec 2021 12:22:50 -0500 Subject: [PATCH] PR Issue 1932 (#1934) * Fix ScaleFile.objects.filter_files ingest time and mime type filters * fix with a workaround * fix second attempt --- scale/job/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scale/job/models.py b/scale/job/models.py index 360ca97b8..af0ebf650 100644 --- a/scale/job/models.py +++ b/scale/job/models.py @@ -245,8 +245,8 @@ def filter_jobs(self, started=None, ended=None, source_started=None, source_ende jobs = duration.order_by("duration") # Bernard - i still dont understand Django auto-magic, but this is a workaround for this bug. If job_type passed its a type cast error on sort, thinks it an INT - elif order=='job_type': - jobs = jobs.order_by('job_type__name') + elif order and order[0].endswith("job_type"): + jobs = jobs.order_by(order[0]+'__name') # Apply other sorting elif order: