From ace4cad7fb5303392a5f1b997fa2a6eac42bd4aa Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Tue, 29 Jan 2019 10:28:07 +0000 Subject: [PATCH] Correctly limit the table data without affecting activity --- opentech/apply/funds/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py index 76e3dbf08..b75cf1232 100644 --- a/opentech/apply/funds/views.py +++ b/opentech/apply/funds/views.py @@ -3,7 +3,7 @@ from copy import copy from django.contrib.auth.decorators import login_required from django.contrib import messages from django.core.exceptions import PermissionDenied -from django.db.models import Q +from django.db.models import F, Q from django.http import HttpResponseRedirect, Http404 from django.shortcuts import get_object_or_404 from django.urls import reverse_lazy @@ -85,8 +85,8 @@ class SubmissionOverviewView(AllActivityContextMixin, BaseAdminSubmissionsTable) table_pagination = False filter_action = reverse_lazy('funds:submissions:list') - def get_queryset(self): - return super().get_queryset()[:5] + def get_table_data(self): + return super().get_table_data().order_by(F('last_update').desc(nulls_last=True))[:5] def get_context_data(self, **kwargs): base_query = RoundsAndLabs.objects.with_progress().order_by('end_date') -- GitLab