Skip to content

Commit

Permalink
Merge pull request #2015 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
updated leaderboard api
  • Loading branch information
Kochouseph26John authored Jun 6, 2024
2 parents a1a08ef + 0785d1d commit 6da4934
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions api/launchpad/launchpad_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@ def get(self, request):
task__hashtag='#lp24-introduction',
).values('user')

allowed_org_types = UserOrganizationLink.objects.filter(
org__org_type__in=["College", "School", "Company"])


users = User.objects.filter(
karma_activity_log_user__task__event="launchpad",
karma_activity_log_user__appraiser_approved=True,
id__in=intro_task_completed_users,
).prefetch_related(
Prefetch(
"user_organization_link_user",
queryset=UserOrganizationLink.objects.filter(
org__org_type__in=["College", "School", "Company"]
),
)
user_organization_link_org__in=allowed_org_types,
).annotate(
karma=Subquery(total_karma_subquery, output_field=IntegerField()),
org=F("user_organization_link_user__org__title"),
Expand Down

0 comments on commit 6da4934

Please sign in to comment.