diff --git a/scale/job/models.py b/scale/job/models.py index 993ae2d590..360ca97b8f 100644 --- a/scale/job/models.py +++ b/scale/job/models.py @@ -244,6 +244,10 @@ def filter_jobs(self, started=None, ended=None, source_started=None, source_ende duration = jobs.annotate(duration=exp_wrapper) 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') + # Apply other sorting elif order: ordering = alphabetize(order, Job.ALPHABETIZE_FIELDS)