chore: create activity when a block is converter into an issue (#609)

This commit is contained in:
pablohashescobar 2023-03-30 18:58:51 +05:30 committed by GitHub
parent 1d7b65ad83
commit f79fdbf782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ from plane.db.models import (
PageFavorite,
Issue,
IssueAssignee,
IssueActivity,
)
from plane.api.serializers import (
PageSerializer,
@ -213,6 +214,15 @@ class CreateIssueFromPageBlockEndpoint(BaseAPIView):
_ = IssueAssignee.objects.create(
issue=issue, assignee=request.user, project_id=project_id
)
_ = IssueActivity.objects.create(
issue=issue,
actor=request.user,
project_id=project_id,
comment=f"{request.user.email} created the issue from {page_block.name} block",
verb="created",
)
page_block.issue = issue
page_block.save()