Skip to content

Commit

Permalink
Merge pull request #2098 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jelanmathewjames authored Jun 20, 2024
2 parents 464311d + e2411c3 commit 0922337
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions api/launchpad/launchpad_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get(self, request):
).values('user').annotate(
total_karma=Sum('karma')
).values('total_karma')
allowed_org_types = ["College", "School", "Company", "Community"]
allowed_org_types = ["College", "School", "Company"]

intro_task_completed_users = KarmaActivityLog.objects.filter(
task__event='launchpad',
Expand All @@ -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__user_id__in=UserOrganizationLink.objects.filter(
Q(user_organization_link_user__id__in=UserOrganizationLink.objects.filter(
org__org_type__in=allowed_org_types
).values("user_id")) | Q(user_organization_link_user__id__isnull=True)
).values("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"),
Expand Down Expand Up @@ -93,9 +93,9 @@ def get(self, request):
queryset=UserRoleLink.objects.filter(verified=True, role__title__in=allowed_levels).select_related('role')
)
).filter(
user_organization_link_user__id__in=UserOrganizationLink.objects.filter(
Q(user_organization_link_user__id__in=UserOrganizationLink.objects.filter(
org__org_type__in=allowed_org_types
).values("id")
).values("id")) | Q(user_organization_link_user__id__isnull=True)
).annotate(
org=F("user_organization_link_user__org__title"),
district_name=F("user_organization_link_user__org__district__name"),
Expand Down
12 changes: 6 additions & 6 deletions api/launchpad/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_rank(self, obj):
).values('user').annotate(
total_karma=Sum('karma')
).values('total_karma')
allowed_org_types = ["College", "School", "Company", "Community"]
allowed_org_types = ["College", "School", "Company"]

intro_task_completed_users = KarmaActivityLog.objects.filter(
task__event='launchpad',
Expand All @@ -50,9 +50,9 @@ def get_rank(self, obj):
queryset=UserOrganizationLink.objects.filter(org__org_type__in=allowed_org_types),
)
).filter(
Q(user_organization_link_user__user_id__in=UserOrganizationLink.objects.filter(
Q(user_organization_link_user__id__in=UserOrganizationLink.objects.filter(
org__org_type__in=allowed_org_types
).values("user_id")) | Q(user_organization_link_user__id__isnull=True)
).values("id")) | Q(user_organization_link_user__id__isnull=True)
).annotate(
karma=Subquery(total_karma_subquery, output_field=IntegerField()),
time_=Max("karma_activity_log_user__created_at"),
Expand All @@ -69,9 +69,9 @@ def get_rank(self, obj):


class LaunchpadParticipantsSerializer(serializers.ModelSerializer):
org = serializers.CharField()
district_name = serializers.CharField()
state = serializers.CharField()
org = serializers.CharField(allow_null=True, allow_blank=True)
district_name = serializers.CharField(allow_null=True, allow_blank=True)
state = serializers.CharField(allow_null=True, allow_blank=True)
level = serializers.CharField()

class Meta:
Expand Down

0 comments on commit 0922337

Please sign in to comment.