Skip to content

Commit

Permalink
Merge pull request #1343 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
kkem minor fix
  • Loading branch information
adnankattekaden authored Oct 17, 2023
2 parents 9d66d55 + 89dab25 commit 1b60399
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/common/common_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get(self, request):
learning_circle_count = LearningCircle.objects.all().count()
total_no_enrollment = UserCircleLink.objects.filter(accepted=True).count()
circle_count_by_ig = LearningCircle.objects.all().values(ig_name=F('ig__name')).annotate(
total_circles=Count('id'))
total_circles=Count('id'), total_users=Count('user', distinct=True))
unique_user_count = UserCircleLink.objects.filter(accepted=True).values('user').distinct().count()
return CustomResponse(response={'lc_count': learning_circle_count, 'total_enrollment': total_no_enrollment,
'circle_count_by_ig': circle_count_by_ig,
Expand All @@ -43,7 +43,7 @@ def get(self, request):
student_info = UserCircleLink.objects.filter(
accepted=True,
user__user_organization_link_user__org__org_type=OrganizationType.COLLEGE.value,
circle__created_at=date,
created_at=date,
).values(
first_name=F('user__first_name'),
last_name=F('user__last_name'),
Expand Down Expand Up @@ -85,7 +85,8 @@ def get(self, request):

paginated_queryset = CommonUtils.get_paginated_queryset(student_info, request,
search_fields=['first_name', 'last_name', 'muid'],
sort_fields={'name': 'name'})
sort_fields={'first_name': 'first_name',
'muid': 'muid'})

student_info_data = StudentInfoSerializer(paginated_queryset.get('queryset'), many=True).data

Expand Down Expand Up @@ -129,7 +130,8 @@ def get(self, request):
OrganizationType.COMMUNITY.value]
).values('org_type').annotate(org_count=Coalesce(Count('org_type'), 0))

enablers_mentors_count = UserRoleLink.objects.filter(role__title__in=["Mentor", "Enabler"]).values('role__title').annotate(role_count=Coalesce(Count('role__title'), 0))
enablers_mentors_count = UserRoleLink.objects.filter(role__title__in=["Mentor", "Enabler"]).values(
'role__title').annotate(role_count=Coalesce(Count('role__title'), 0))

interest_groups_count = InterestGroup.objects.all().count()
learning_circles_count = LearningCircle.objects.all().count()
Expand Down

0 comments on commit 1b60399

Please sign in to comment.