diff --git a/apiserver/plane/api/views/notification.py b/apiserver/plane/api/views/notification.py index 86cc74d3f..e81fd2b5f 100644 --- a/apiserver/plane/api/views/notification.py +++ b/apiserver/plane/api/views/notification.py @@ -33,7 +33,7 @@ class NotificationViewSet(BaseViewSet): order_by = request.GET.get("order_by", "-created_at") snoozed = request.GET.get("snoozed", "false") archived = request.GET.get("archived", "false") - read = request.GET.get("read", "false") + read = request.GET.get("read", "true") # Filter type type = request.GET.get("type", "all") @@ -53,8 +53,6 @@ class NotificationViewSet(BaseViewSet): Q(snoozed_till__lt=timezone.now()) | Q(snoozed_till__isnull=False) ) - if read == "true": - notifications = notifications.filter(read_at__isnull=False) if read == "false": notifications = notifications.filter(read_at__isnull=True) @@ -213,7 +211,7 @@ class UnreadNotificationEndpoint(BaseAPIView): def get(self, request, slug): try: # Watching Issues Count - watching_notification_count = Notification.objects.filter( + watching_issues_count = Notification.objects.filter( workspace__slug=slug, receiver_id=request.user.id, read_at__isnull=True, @@ -244,7 +242,7 @@ class UnreadNotificationEndpoint(BaseAPIView): return Response( { - "watching_notifications": watching_notification_count, + "watching_issues": watching_issues_count, "my_issues": my_issues_count, "created_issues": created_issues_count, }, diff --git a/apiserver/plane/bgtasks/issue_activites_task.py b/apiserver/plane/bgtasks/issue_activites_task.py index 9fb9f79e0..e45ad9b32 100644 --- a/apiserver/plane/bgtasks/issue_activites_task.py +++ b/apiserver/plane/bgtasks/issue_activites_task.py @@ -1030,6 +1030,7 @@ def issue_activity( issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first() + if issue is not None: issue.updated_at = timezone.now() issue.save(update_fields=["updated_at"]) @@ -1110,6 +1111,8 @@ def issue_activity( issue_subscribers = issue_subscribers + issue_assignees + issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first() + # Add bot filtering if issue is not None and issue.created_by_id is not None and not issue.created_by.is_bot: issue_subscribers = issue_subscribers + [issue.created_by_id]