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

Method post

apps/api/plane/app/views/api.py:21–39  ·  view source on GitHub ↗
(self, request: Request)

Source from the content-addressed store, hash-verified

19
20class ApiTokenEndpoint(BaseAPIView):
21 def post(self, request: Request) -> Response:
22 label = request.data.get("label", str(uuid4().hex))
23 description = request.data.get("description", "")
24 expired_at = request.data.get("expired_at", None)
25
26 # Check the user type
27 user_type = 1 if request.user.is_bot else 0
28
29 api_token = APIToken.objects.create(
30 label=label,
31 description=description,
32 user=request.user,
33 user_type=user_type,
34 expired_at=expired_at,
35 )
36
37 serializer = APITokenSerializer(api_token)
38 # Token will be only visible while creating
39 return Response(serializer.data, status=status.HTTP_201_CREATED)
40
41 def get(self, request: Request, pk: Optional[str] = None) -> Response:
42 if pk is None:

Callers 15

postFunction · 0.45
createMethod · 0.45
addIssuesToModuleMethod · 0.45
addModulesToIssueMethod · 0.45
createModuleLinkMethod · 0.45
addModuleToFavoritesMethod · 0.45
addIssuesToModuleMethod · 0.45
addModulesToIssueMethod · 0.45
addModuleToFavoritesMethod · 0.45
createMethod · 0.45
emailCheckMethod · 0.45
sendResetPasswordLinkMethod · 0.45

Calls 3

APITokenSerializerClass · 0.90
getMethod · 0.45
createMethod · 0.45