fix: uuid error when cycle and module updates (#1585)

This commit is contained in:
Nikhil 2023-07-20 14:18:28 +05:30 committed by GitHub
parent 34123681cf
commit 5e625ab132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1028,7 +1028,12 @@ def issue_activity(
actor = User.objects.get(pk=actor_id) actor = User.objects.get(pk=actor_id)
project = Project.objects.get(pk=project_id) project = Project.objects.get(pk=project_id)
if type not in [
"cycle.activity.created",
"cycle.activity.deleted",
"module.activity.created",
"module.activity.deleted",
]:
issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first() issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first()
if issue is not None: if issue is not None:
@ -1094,6 +1099,12 @@ def issue_activity(
except Exception as e: except Exception as e:
capture_exception(e) capture_exception(e)
if type not in [
"cycle.activity.created",
"cycle.activity.deleted",
"module.activity.created",
"module.activity.deleted",
]:
# Create Notifications # Create Notifications
bulk_notifications = [] bulk_notifications = []
@ -1114,7 +1125,11 @@ def issue_activity(
issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first() issue = Issue.objects.filter(pk=issue_id, project_id=project_id).first()
# Add bot filtering # Add bot filtering
if issue is not None and 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]
for subscriber in issue_subscribers: for subscriber in issue_subscribers:
@ -1146,7 +1161,9 @@ def issue_activity(
"new_value": str(issue_activity.new_value), "new_value": str(issue_activity.new_value),
"old_value": str(issue_activity.old_value), "old_value": str(issue_activity.old_value),
"issue_comment": str( "issue_comment": str(
issue_activity.issue_comment.comment_stripped if issue_activity.issue_comment is not None else "" issue_activity.issue_comment.comment_stripped
if issue_activity.issue_comment is not None
else ""
), ),
}, },
}, },