File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -314,7 +314,10 @@ def export(self):
314314 except Exception as e :
315315 return result .error (str (e ), response_status = status .HTTP_500_INTERNAL_SERVER_ERROR )
316316
317- def pylint (self , instance , is_valid = True ):
317+ class Pylint (serializers .Serializer ):
318+ workspace_id = serializers .CharField (required = True , label = _ ('workspace id' ))
319+
320+ def run (self , instance , is_valid = True ):
318321 if is_valid :
319322 self .is_valid (raise_exception = True )
320323 PylintInstance (data = instance ).is_valid (raise_exception = True )
Original file line number Diff line number Diff line change 66urlpatterns = [
77 path ('workspace/<str:workspace_id>/tool' , views .ToolView .as_view ()),
88 path ('workspace/<str:workspace_id>/tool/import' , views .ToolView .Import .as_view ()),
9+ path ('workspace/<str:workspace_id>/tool/pylint' , views .ToolView .Pylint .as_view ()),
910 path ('workspace/<str:workspace_id>/tool/<str:tool_id>' , views .ToolView .Operate .as_view ()),
1011 path ('workspace/<str:workspace_id>/tool/<str:tool_id>/debug' , views .ToolView .Debug .as_view ()),
11- path ('workspace/<str:workspace_id>/tool/<str:tool_id>/pylint' , views .ToolView .Pylint .as_view ()),
1212 path ('workspace/<str:workspace_id>/tool/<str:tool_id>/export' , views .ToolView .Export .as_view ()),
1313 path ('workspace/<str:workspace_id>/tool/<int:current_page>/<int:page_size>' , views .ToolView .Page .as_view ()),
1414]
Original file line number Diff line number Diff line change @@ -181,15 +181,15 @@ class Pylint(APIView):
181181 @extend_schema (
182182 methods = ['POST' ],
183183 summary = _ ('Check code' ),
184- operation_id = _ ('Check code' ), # type: ignore
184+ operation_id = _ ('Check code' ), # type: ignore
185185 description = _ ('Check code' ),
186186 request = PylintAPI .get_request (),
187187 responses = PylintAPI .get_response (),
188188 parameters = PylintAPI .get_parameters (),
189- tags = [_ ('Tool' )] # type: ignore
189+ tags = [_ ('Tool' )] # type: ignore
190190 )
191191 @has_permissions (PermissionConstants .TOOL_EXPORT .get_workspace_permission ())
192- def post (self , request : Request , workspace_id : str , tool_id : str ):
193- return result .success (ToolSerializer .Operate (
194- data = {'id' : tool_id , ' workspace_id' : workspace_id }
195- ).pylint (request .data ))
192+ def post (self , request : Request , workspace_id : str ):
193+ return result .success (ToolSerializer .Pylint (
194+ data = {'workspace_id' : workspace_id }
195+ ).run (request .data ))
You can’t perform that action at this time.
0 commit comments