mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 22:09:12 +02:00
chore: handled project parent issue error in issue list (#2090)
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user