From d4c842521852248d61c5104db481ef228713431e Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Fri, 19 Apr 2024 17:02:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BF=AB=E6=8D=B7=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E9=80=89=E6=8B=A9=E6=9C=AA=E6=8C=89=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E6=95=B0=E9=87=8F=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/api/job.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/ops/api/job.py b/apps/ops/api/job.py index 98fded770..f67c886c4 100644 --- a/apps/ops/api/job.py +++ b/apps/ops/api/job.py @@ -304,6 +304,6 @@ class UsernameHintsAPI(APIView): .filter(username__icontains=query) \ .filter(asset__in=assets) \ .values('username') \ - .annotate(total=Count('username', distinct=True)) \ - .order_by('total', '-username')[:10] + .annotate(total=Count('username')) \ + .order_by('-total', '-username')[:10] return Response(data=top_accounts)