From d16e645af8099cf8c712c73a42e8a38484c53427 Mon Sep 17 00:00:00 2001 From: jelanmathewjames Date: Fri, 5 Jul 2024 16:50:02 +0530 Subject: [PATCH 1/2] refactor: Update allowed organization types in launchpad leaderboard --- api/launchpad/launchpad_views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/launchpad/launchpad_views.py b/api/launchpad/launchpad_views.py index fd7833b3..aed7dbc6 100644 --- a/api/launchpad/launchpad_views.py +++ b/api/launchpad/launchpad_views.py @@ -43,9 +43,9 @@ def get(self, request): queryset=UserOrganizationLink.objects.filter(org__org_type__in=allowed_org_types), ) ).filter( - Q(user_organization_link_user__id__in=UserOrganizationLink.objects.filter( - org__org_type__in=["College", "School", "Company", "Community"] - ).values("id")) | Q(user_organization_link_user__id__isnull=True) + Q(user_organization_link_user__user_id__in=UserOrganizationLink.objects.filter( + org__org_type__in=["College", "School", "Company"] + ).values("user_id")) | Q(user_organization_link_user__id__isnull=True) ).annotate( karma=Subquery(total_karma_subquery, output_field=IntegerField()), org=F("user_organization_link_user__org__title"), From 2f92a032ac30109634c442b8abf1954d858648a5 Mon Sep 17 00:00:00 2001 From: jelanmathewjames Date: Fri, 5 Jul 2024 16:51:09 +0530 Subject: [PATCH 2/2] refactor: Update allowed organization types in launchpad leaderboard --- api/launchpad/launchpad_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/launchpad/launchpad_views.py b/api/launchpad/launchpad_views.py index aed7dbc6..9ea2d001 100644 --- a/api/launchpad/launchpad_views.py +++ b/api/launchpad/launchpad_views.py @@ -44,7 +44,7 @@ def get(self, request): ) ).filter( Q(user_organization_link_user__user_id__in=UserOrganizationLink.objects.filter( - org__org_type__in=["College", "School", "Company"] + org__org_type__in=["College", "School", "Company", "Community"] ).values("user_id")) | Q(user_organization_link_user__id__isnull=True) ).annotate( karma=Subquery(total_karma_subquery, output_field=IntegerField()),