diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 196e66ea1b..0284b1abcd 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -2630,15 +2630,7 @@ if toastermain.settings.MANAGED: | |||
2630 | Q(name__icontains=request.GET['targets_search']) | | 2630 | Q(name__icontains=request.GET['targets_search']) | |
2631 | Q(summary__icontains=request.GET['targets_search'])) | 2631 | Q(summary__icontains=request.GET['targets_search'])) |
2632 | 2632 | ||
2633 | targets = Paginator(targets_query.order_by("name"), limit) | 2633 | targets = _build_page_range(Paginator(targets_query.order_by("name"), limit), request.GET.get('tpage', 1)) |
2634 | |||
2635 | if request.GET.has_key("tpage"): | ||
2636 | try: | ||
2637 | targets = targets.page(request.GET['tpage']) | ||
2638 | except EmptyPage: | ||
2639 | targets = targets.page(targets.num_pages) | ||
2640 | else: | ||
2641 | targets = targets.page(1) | ||
2642 | 2634 | ||
2643 | machines_query = Machine.objects.filter(layer_version=layer_version) | 2635 | machines_query = Machine.objects.filter(layer_version=layer_version) |
2644 | 2636 | ||
@@ -2648,15 +2640,7 @@ if toastermain.settings.MANAGED: | |||
2648 | Q(name__icontains=request.GET['machines_search']) | | 2640 | Q(name__icontains=request.GET['machines_search']) | |
2649 | Q(description__icontains=request.GET['machines_search'])) | 2641 | Q(description__icontains=request.GET['machines_search'])) |
2650 | 2642 | ||
2651 | machines = Paginator(machines_query.order_by("name"), limit) | 2643 | machines = _build_page_range(Paginator(machines_query.order_by("name"), limit), request.GET.get('mpage', 1)) |
2652 | |||
2653 | if request.GET.has_key("mpage"): | ||
2654 | try: | ||
2655 | machines = machines.page(request.GET['mpage']) | ||
2656 | except EmptyPage: | ||
2657 | machines = machines.page(machines.num_pages) | ||
2658 | else: | ||
2659 | machines = machines.page(1) | ||
2660 | 2644 | ||
2661 | context = { | 2645 | context = { |
2662 | 'layerversion': layer_version, | 2646 | 'layerversion': layer_version, |