parameters: (self, request:Request, project_id)
return_statement: return Response({
              'delete': delete,
          })
docstring: Revoke a project token.
          ---
          parameters:
            - name: token
              required: true
  
          serializer: SimpleProjectTokenSerializer
docstring_summary: Revoke a project token.
          ---
          parameters:
            - name: token
              required: true
docstring_tokens: Revoke a project token . --- parameters : - name : token required : true
function: def post(self, request:Request, project_id) -> Response:
          """Revoke a project token.
          ---
          parameters:
            - name: token
              required: true
  
          serializer: SimpleProjectTokenSerializer
          """
          if request.user.is_anonymous:
              raise PermissionError("Anonymous users can't revoke tokens")
  
          token = get_object_or_404(ProjectToken, pk=request.POST.get('token_id'))
  
          for perm in token.default_permissions:
              remove_perm(perm, request.user, token.project)
  
          delete = UserProjectToken.objects.filter(project_token=token,
                  user_id=request.user.id).delete()
  
          return Response({
              'delete': delete,
          })
function_tokens: def post ( self , request : Request , project_id ) -> Response : if request . user . is_anonymous : raise PermissionError ( "Anonymous users can't revoke tokens" ) token = get_object_or_404 ( ProjectToken , pk = request . POST . get ( 'token_id' ) ) for perm in token . default_permissions : remove_perm ( perm , request . user , token . project ) delete = UserProjectToken . objects . filter ( project_token = token , user_id = request . user . id ) . delete ( ) return Response ( { 'delete' : delete , } )