@@ -329,13 +329,21 @@ def update_test_tags(self):
329329
330330 def update_import_history (
331331 self ,
332- new_findings : list [Finding ] = [] ,
333- closed_findings : list [Finding ] = [] ,
334- reactivated_findings : list [Finding ] = [] ,
335- untouched_findings : list [Finding ] = [] ,
332+ new_findings : list [Finding ] | None = None ,
333+ closed_findings : list [Finding ] | None = None ,
334+ reactivated_findings : list [Finding ] | None = None ,
335+ untouched_findings : list [Finding ] | None = None ,
336336 ) -> Test_Import :
337337 """Creates a record of the import or reimport operation that has occurred."""
338338 # Quick fail check to determine if we even wanted this
339+ if untouched_findings is None :
340+ untouched_findings = []
341+ if reactivated_findings is None :
342+ reactivated_findings = []
343+ if closed_findings is None :
344+ closed_findings = []
345+ if new_findings is None :
346+ new_findings = []
339347 if settings .TRACK_IMPORT_HISTORY is False :
340348 return None
341349 # Log the current state of what has occurred in case there could be
@@ -763,11 +771,19 @@ def notify_scan_added(
763771 self ,
764772 test ,
765773 updated_count ,
766- new_findings = [] ,
767- findings_mitigated = [] ,
768- findings_reactivated = [] ,
769- findings_untouched = [] ,
774+ new_findings = None ,
775+ findings_mitigated = None ,
776+ findings_reactivated = None ,
777+ findings_untouched = None ,
770778 ):
779+ if findings_untouched is None :
780+ findings_untouched = []
781+ if findings_reactivated is None :
782+ findings_reactivated = []
783+ if findings_mitigated is None :
784+ findings_mitigated = []
785+ if new_findings is None :
786+ new_findings = []
771787 logger .debug ("Scan added notifications" )
772788
773789 new_findings = sorted (new_findings , key = lambda x : x .numerical_severity )
0 commit comments