chore: handled project parent issue error in issue list (#2090)

This commit is contained in:
guru_sainath
2025-01-02 21:04:35 +05:30
committed by GitHub
parent bc1b4db54f
commit 3eafdc6922
2 changed files with 11 additions and 13 deletions

View File

@@ -119,14 +119,14 @@ class IssueMutation:
await sync_to_async(IssueAssignee.objects.bulk_create)(
[
IssueAssignee(
assignee_id=user,
assignee_id=assignee,
issue=issue,
workspace=workspace,
project_id=project,
created_by_id=user.id,
updated_by_id=user.id,
)
for user in assignees
for assignee in assignees
],
batch_size=10,
)

View File

@@ -11,7 +11,6 @@ import strawberry_django
from strawberry.scalars import JSON
from strawberry.types import Info
# Module Imports
from plane.db.models import (
Issue,
@@ -23,6 +22,7 @@ from plane.db.models import (
CycleIssue,
ModuleIssue,
IssueType,
ProjectMember,
)
@@ -77,16 +77,14 @@ class IssuesType:
return self.state_id
@strawberry.field
def parent(self) -> Optional[strawberry.ID]:
return (
self.parent_id
if self.parent_id
and self.parent.project.id != self.project_id
and self.parent.project.project__member.filter(
member_id=self.created_by, is_active=True, deleted_at__isnull=True
).exists()
else None
)
async def parent(self) -> Optional[strawberry.ID]:
if self.parent:
parent_issue_project_id = await sync_to_async(
lambda: self.parent.project_id if self.parent else None
)()
if parent_issue_project_id == self.project_id:
return str(self.parent_id)
return None
@strawberry.field
def project(self) -> int: