From 9ba8f5c21fccfae414d692de93b87c795c20b476 Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:59:58 +0530 Subject: [PATCH] fix: cycle module notifications (#1536) * chore: add triggered by details for notifications * dev: update issue activity json to include extra fields * dev: improve issue fetch --- apiserver/plane/bgtasks/issue_activites_task.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/apiserver/plane/bgtasks/issue_activites_task.py b/apiserver/plane/bgtasks/issue_activites_task.py index 2a7c6eddc..9fb9f79e0 100644 --- a/apiserver/plane/bgtasks/issue_activites_task.py +++ b/apiserver/plane/bgtasks/issue_activites_task.py @@ -1029,13 +1029,10 @@ def issue_activity( project = Project.objects.get(pk=project_id) - try: - issue = Issue.objects.get(pk=issue_id) + 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"]) - except Exception as e: - pass - if subscriber: # add the user to issue subscriber @@ -1114,10 +1111,9 @@ def issue_activity( issue_subscribers = issue_subscribers + issue_assignees # Add bot filtering - if issue.created_by_id is not None and not issue.created_by.is_bot: + 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] - issue = Issue.objects.get(project=project, pk=issue_id) for subscriber in issue_subscribers: for issue_activity in issue_activities_created: bulk_notifications.append(