Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

fix: changed the response structure (#6301)

Bavisetti Narayan5e6c02358d37
diff --git a/apiserver/plane/app/views/page/base.py b/apiserver/plane/app/views/page/base.py
index 9243a3f9fd..6f98d79523 100644
--- a/apiserver/plane/app/views/page/base.py
+++ b/apiserver/plane/app/views/page/base.py
@@ -572,6 +572,7 @@ class PageDuplicateEndpoint(BaseAPIView):
page.pk = None
page.name = f"{page.name} (Copy)"
page.description_binary = None
+ page.owned_by = request.user
page.save()
for project_id in project_ids:
@@ -586,6 +587,17 @@ class PageDuplicateEndpoint(BaseAPIView):
page_transaction.delay(
{"description_html": page.description_html}, None, page.id
)
- page = Page.objects.get(pk=page.id)
+ page = (
+ Page.objects.filter(pk=page.id)
+ .annotate(
+ project_ids=Coalesce(
+ ArrayAgg(
+ "projects__id", distinct=True, filter=~Q(projects__id=True)
+ ),
+ Value([], output_field=ArrayField(UUIDField())),
+ )
+ )
+ .first()
+ )
serializer = PageDetailSerializer(page)
return Response(serializer.data, status=status.HTTP_201_CREATED)