Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-1042] fix: dashboard collaborators active issue count (#4256)

Bavisetti Narayanaee48f6fa410
diff --git a/apiserver/plane/app/views/dashboard/base.py b/apiserver/plane/app/views/dashboard/base.py
index 33b3cf9d5b..9558348d90 100644
--- a/apiserver/plane/app/views/dashboard/base.py
+++ b/apiserver/plane/app/views/dashboard/base.py
@@ -571,14 +571,16 @@ def dashboard_recent_collaborators(self, request, slug):
return self.paginate(
request=request,
queryset=project_members_with_activities,
- controller=self.get_results_controller,
+ controller=lambda qs: self.get_results_controller(qs, slug),
)
class DashboardEndpoint(BaseAPIView):
- def get_results_controller(self, project_members_with_activities):
+ def get_results_controller(self, project_members_with_activities, slug):
user_active_issue_counts = (
- User.objects.filter(id__in=project_members_with_activities)
+ User.objects.filter(
+ id__in=project_members_with_activities,
+ )
.annotate(
active_issue_count=Count(
Case(
@@ -587,10 +589,13 @@ class DashboardEndpoint(BaseAPIView):
"unstarted",
"started",
],
- then=1,
+ issue_assignee__issue__workspace__slug=slug,
+ issue_assignee__issue__project__project_projectmember__is_active=True,
+ then=F("issue_assignee__issue__id"),
),
output_field=IntegerField(),
- )
+ ),
+ distinct=True,
)
)
.values("active_issue_count", user_id=F("id"))
diff --git a/apiserver/plane/db/management/commands/test_email.py b/apiserver/plane/db/management/commands/test_email.py
index 99c5d9684f..63b602518e 100644
--- a/apiserver/plane/db/management/commands/test_email.py
+++ b/apiserver/plane/db/management/commands/test_email.py
@@ -15,7 +15,7 @@ class Command(BaseCommand):
receiver_email = options.get("to_email")
if not receiver_email:
- raise CommandError("Reciever email is required")
+ raise CommandError("Receiver email is required")
(
EMAIL_HOST,
@@ -54,7 +54,7 @@ class Command(BaseCommand):
connection=connection,
)
msg.send()
- self.stdout.write(self.style.SUCCESS("Email succesfully sent"))
+ self.stdout.write(self.style.SUCCESS("Email successfully sent"))
except Exception as e:
self.stdout.write(
self.style.ERROR(