@@ -693,9 +693,7 @@ def add_tests(request, eid):
693693
694694class ImportScanResultsView (View ):
695695 def get_template (self ) -> str :
696- """
697- Returns the template that will be presented to the user
698- """
696+ """Returns the template that will be presented to the user"""
699697 return "dojo/import_scan_results.html"
700698
701699 def get_development_environment (
@@ -715,9 +713,7 @@ def get_engagement_or_product(
715713 engagement_id : Optional [int ] = None ,
716714 product_id : Optional [int ] = None ,
717715 ) -> Tuple [Engagement , Product , Product | Engagement ]:
718- """
719- Using the path parameters, either fetch the product or engagement
720- """
716+ """Using the path parameters, either fetch the product or engagement"""
721717 engagement = product = engagement_or_product = None
722718 # Get the product if supplied
723719 # Get the engagement if supplied
@@ -740,9 +736,7 @@ def get_form(
740736 request : HttpRequest ,
741737 ** kwargs : dict ,
742738 ) -> ImportScanForm :
743- """
744- Returns the default import form for importing findings
745- """
739+ """Returns the default import form for importing findings"""
746740 if request .method == "POST" :
747741 return ImportScanForm (request .POST , request .FILES , ** kwargs )
748742 return ImportScanForm (** kwargs )
@@ -776,9 +770,7 @@ def get_jira_form(
776770 request : HttpRequest ,
777771 engagement_or_product : Engagement | Product ,
778772 ) -> Tuple [JIRAImportScanForm | None , bool ]:
779- """
780- Returns a JiraImportScanForm if jira is enabled
781- """
773+ """Returns a JiraImportScanForm if jira is enabled"""
782774 jira_form = None
783775 push_all_jira_issues = False
784776 # Determine if jira issues should be pushed automatically
@@ -919,18 +911,14 @@ def get_importer(
919911 self ,
920912 context : dict ,
921913 ) -> BaseImporter :
922- """
923- Gets the importer to use
924- """
914+ """Gets the importer to use"""
925915 return DefaultImporter (** context )
926916
927917 def import_findings (
928918 self ,
929919 context : dict ,
930920 ) -> str | None :
931- """
932- Attempt to import with all the supplied information
933- """
921+ """Attempt to import with all the supplied information"""
934922 try :
935923 importer_client = self .get_importer (context )
936924 context ["test" ], _ , finding_count , closed_finding_count , _ , _ , _ = importer_client .process_scan (
@@ -952,9 +940,7 @@ def process_form(
952940 form : ImportScanForm ,
953941 context : dict ,
954942 ) -> str | None :
955- """
956- Process the form and manipulate the input in any way that is appropriate
957- """
943+ """Process the form and manipulate the input in any way that is appropriate"""
958944 # Update the running context dict with cleaned form input
959945 context .update ({
960946 "scan" : request .FILES .get ("file" , None ),
@@ -1024,9 +1010,7 @@ def process_credentials_form(
10241010 form : CredMappingForm ,
10251011 context : dict ,
10261012 ) -> str | None :
1027- """
1028- Process the credentials form by creating
1029- """
1013+ """Process the credentials form by creating"""
10301014 if cred_user := form .cleaned_data ["cred_user" ]:
10311015 # Select the credential mapping object from the selected list and only allow if the credential is associated with the product
10321016 cred_user = Cred_Mapping .objects .filter (
@@ -1046,18 +1030,14 @@ def success_redirect(
10461030 self ,
10471031 context : dict ,
10481032 ) -> HttpResponseRedirect :
1049- """
1050- Redirect the user to a place that indicates a successful import
1051- """
1033+ """Redirect the user to a place that indicates a successful import"""
10521034 return HttpResponseRedirect (reverse ("view_test" , args = (context .get ("test" ).id , )))
10531035
10541036 def failure_redirect (
10551037 self ,
10561038 context : dict ,
10571039 ) -> HttpResponseRedirect :
1058- """
1059- Redirect the user to a place that indicates a failed import
1060- """
1040+ """Redirect the user to a place that indicates a failed import"""
10611041 return HttpResponseRedirect (reverse (
10621042 "import_scan_results" ,
10631043 args = (context .get ("engagement" , context .get ("product" )).id , ),
@@ -1069,9 +1049,7 @@ def get(
10691049 engagement_id : Optional [int ] = None ,
10701050 product_id : Optional [int ] = None ,
10711051 ) -> HttpResponse :
1072- """
1073- Process GET requests for the Import View
1074- """
1052+ """Process GET requests for the Import View"""
10751053 # process the request and path parameters
10761054 request , context = self .handle_request (
10771055 request ,
@@ -1087,9 +1065,7 @@ def post(
10871065 engagement_id : Optional [int ] = None ,
10881066 product_id : Optional [int ] = None ,
10891067 ) -> HttpResponse :
1090- """
1091- Process POST requests for the Import View
1092- """
1068+ """Process POST requests for the Import View"""
10931069 # process the request and path parameters
10941070 request , context = self .handle_request (
10951071 request ,
0 commit comments