fix: user id for default analytics (#1808)

This commit is contained in:
Nikhil 2023-08-11 12:45:04 +05:30 committed by GitHub
parent 085cd1960e
commit 11abd3cadf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,21 +243,21 @@ class DefaultAnalyticsEndpoint(BaseAPIView):
) )
most_issue_created_user = ( most_issue_created_user = (
queryset.exclude(created_by=None) queryset.exclude(created_by=None)
.values("created_by__first_name", "created_by__last_name", "created_by__avatar", "created_by__display_name") .values("created_by__first_name", "created_by__last_name", "created_by__avatar", "created_by__display_name", "created_by__id")
.annotate(count=Count("id")) .annotate(count=Count("id"))
.order_by("-count") .order_by("-count")
)[:5] )[:5]
most_issue_closed_user = ( most_issue_closed_user = (
queryset.filter(completed_at__isnull=False, assignees__isnull=False) queryset.filter(completed_at__isnull=False, assignees__isnull=False)
.values("assignees__first_name", "assignees__last_name", "assignees__avatar", "assignees__display_name") .values("assignees__first_name", "assignees__last_name", "assignees__avatar", "assignees__display_name", "assignees__id")
.annotate(count=Count("id")) .annotate(count=Count("id"))
.order_by("-count") .order_by("-count")
)[:5] )[:5]
pending_issue_user = ( pending_issue_user = (
queryset.filter(completed_at__isnull=True) queryset.filter(completed_at__isnull=True)
.values("assignees__first_name", "assignees__last_name", "assignees__avatar", "assignees__display_name") .values("assignees__first_name", "assignees__last_name", "assignees__avatar", "assignees__display_name", "assignees__id")
.annotate(count=Count("id")) .annotate(count=Count("id"))
.order_by("-count") .order_by("-count")
) )