MCPcopy
hub / github.com/makeplane/plane / create

Method create

apps/api/plane/app/views/page/base.py:129–152  ·  view source on GitHub ↗
(self, request, slug, project_id)

Source from the content-addressed store, hash-verified

127 )
128
129 def create(self, request, slug, project_id):
130 serializer = PageSerializer(
131 data=request.data,
132 context={
133 "project_id": project_id,
134 "owned_by_id": request.user.id,
135 "description_json": request.data.get("description_json", {}),
136 "description_binary": request.data.get("description_binary", None),
137 "description_html": request.data.get("description_html", "<p></p>"),
138 },
139 )
140
141 if serializer.is_valid():
142 serializer.save()
143 # capture the page transaction
144 page_transaction.delay(
145 new_description_html=request.data.get("description_html", "<p></p>"),
146 old_description_html=None,
147 page_id=serializer.data["id"],
148 )
149 page = self.get_queryset().get(pk=serializer.data["id"])
150 serializer = PageDetailSerializer(page)
151 return Response(serializer.data, status=status.HTTP_201_CREATED)
152 return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
153
154 def partial_update(self, request, slug, project_id, page_id):
155 try:

Callers 7

postMethod · 0.45
createMethod · 0.45
postMethod · 0.45
postMethod · 0.45
postMethod · 0.45
postMethod · 0.45
postMethod · 0.45

Calls 5

get_querysetMethod · 0.95
PageSerializerClass · 0.90
getMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected