Skip to content

Commit

Permalink
Merge pull request #1978 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
Merge dev to dev-server
  • Loading branch information
jelanmathewjames authored May 29, 2024
2 parents 027853f + 7a56591 commit ef07c22
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/launchpad/launchpad_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from utils.response import CustomResponse
from utils.utils import CommonUtils
from db.user import User
from db.organization import UserOrganizationLink
from db.organization import Organization


class Leaderboard(APIView):
Expand All @@ -19,8 +19,8 @@ def get(self, request):
)
.prefetch_related(
Prefetch(
"user_organization_link_user__org__title",
queryset=UserOrganizationLink.objects.all(),
"user_organization_link_user__org",
queryset=Organization.objects.all()
),
).select_related("district", "district__zone__state")
.annotate(
Expand All @@ -36,11 +36,13 @@ def get(self, request):
)
),
time_=Max("karma_activity_log_user__created_at"),
org=F("user_organization_link_user__org__title"),
district_name=F("district__name"),
state=F("district__zone__state__name")
state=F("district__zone__state__name"),
)
.order_by("-karma", "time_")
)

paginated_queryset = CommonUtils.get_paginated_queryset(
users,
request,
Expand Down

0 comments on commit ef07c22

Please sign in to comment.