forked from github/plane
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
This commit is contained in:
parent
059b8c793a
commit
9ba8f5c21f
@ -1029,13 +1029,10 @@ def issue_activity(
|
|||||||
project = Project.objects.get(pk=project_id)
|
project = Project.objects.get(pk=project_id)
|
||||||
|
|
||||||
|
|
||||||
try:
|
issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first()
|
||||||
issue = Issue.objects.get(pk=issue_id)
|
if issue is not None:
|
||||||
issue.updated_at = timezone.now()
|
issue.updated_at = timezone.now()
|
||||||
issue.save(update_fields=["updated_at"])
|
issue.save(update_fields=["updated_at"])
|
||||||
except Exception as e:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
if subscriber:
|
if subscriber:
|
||||||
# add the user to issue subscriber
|
# add the user to issue subscriber
|
||||||
@ -1114,10 +1111,9 @@ def issue_activity(
|
|||||||
issue_subscribers = issue_subscribers + issue_assignees
|
issue_subscribers = issue_subscribers + issue_assignees
|
||||||
|
|
||||||
# Add bot filtering
|
# 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_subscribers = issue_subscribers + [issue.created_by_id]
|
||||||
|
|
||||||
issue = Issue.objects.get(project=project, pk=issue_id)
|
|
||||||
for subscriber in issue_subscribers:
|
for subscriber in issue_subscribers:
|
||||||
for issue_activity in issue_activities_created:
|
for issue_activity in issue_activities_created:
|
||||||
bulk_notifications.append(
|
bulk_notifications.append(
|
||||||
|
Loading…
Reference in New Issue
Block a user