diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-03-13 15:22:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-21 00:00:28 +0000 |
commit | 1f1230c792eeeef8f137430c32f26fb902c02f50 (patch) | |
tree | 8e381e31e2134b7909628a1254cbf2e3859c000e /bitbake | |
parent | 3c5e2917604315775eebe7e62a560a853e5b1c58 (diff) | |
download | poky-1f1230c792eeeef8f137430c32f26fb902c02f50.tar.gz |
bitbake: toaster: tasks trigger the select related tables before ordering
In two of the cases the data is changed from a QuerySet to a sorted list
so we aren't able to use the QuerySet api at this point, moving it
before the data type is changed fixes this.
[YOCTO #7404]
(Bitbake rev: 484797744dbe421dfeea52e9428ba63b44f1ed88)
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 26c876080d..ea47d96eea 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -877,7 +877,10 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
877 | return _redirect_parameters( variant, request.GET, mandatory_parameters, build_id = build_id) | 877 | return _redirect_parameters( variant, request.GET, mandatory_parameters, build_id = build_id) |
878 | (filter_string, search_term, ordering_string) = _search_tuple(request, Task) | 878 | (filter_string, search_term, ordering_string) = _search_tuple(request, Task) |
879 | queryset_all = Task.objects.filter(build=build_id).exclude(order__isnull=True).exclude(outcome=Task.OUTCOME_NA) | 879 | queryset_all = Task.objects.filter(build=build_id).exclude(order__isnull=True).exclude(outcome=Task.OUTCOME_NA) |
880 | queryset_all = queryset_all.select_related("recipe", "build") | ||
881 | |||
880 | queryset_with_search = _get_queryset(Task, queryset_all, None , search_term, ordering_string, 'order') | 882 | queryset_with_search = _get_queryset(Task, queryset_all, None , search_term, ordering_string, 'order') |
883 | |||
881 | if ordering_string.startswith('outcome'): | 884 | if ordering_string.startswith('outcome'): |
882 | queryset = _get_queryset(Task, queryset_all, filter_string, search_term, 'order:+', 'order') | 885 | queryset = _get_queryset(Task, queryset_all, filter_string, search_term, 'order:+', 'order') |
883 | queryset = sorted(queryset, key=lambda ur: (ur.outcome_text), reverse=ordering_string.endswith('-')) | 886 | queryset = sorted(queryset, key=lambda ur: (ur.outcome_text), reverse=ordering_string.endswith('-')) |
@@ -887,7 +890,6 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
887 | else: | 890 | else: |
888 | queryset = _get_queryset(Task, queryset_all, filter_string, search_term, ordering_string, 'order') | 891 | queryset = _get_queryset(Task, queryset_all, filter_string, search_term, ordering_string, 'order') |
889 | 892 | ||
890 | queryset = queryset.select_related("recipe", "build") | ||
891 | 893 | ||
892 | # compute the anchor's page | 894 | # compute the anchor's page |
893 | if anchor: | 895 | if anchor: |