@@ -843,9 +843,6 @@ class ImportScanResource(MultipartResource, Resource):
843843 file = fields .FileField (attribute = 'file' )
844844 engagement = fields .CharField (attribute = 'engagement' )
845845
846- @staticmethod
847-
848-
849846 class Meta :
850847 resource_name = 'importscan'
851848 fields = ['scan_date' , 'minimum_severity' , 'active' , 'verified' , 'scan_type' , 'tags' , 'file' ]
@@ -1112,19 +1109,20 @@ def obj_create(self, bundle, **kwargs):
11121109 )
11131110
11141111 if len (find ) == 1 :
1115- if find [0 ].mitigated :
1112+ find = find [0 ]
1113+ if find .mitigated :
11161114 # it was once fixed, but now back
1117- find [ 0 ] .mitigated = None
1118- find [ 0 ] .mitigated_by = None
1119- find [ 0 ] .active = True
1120- find [ 0 ] .verified = verified
1121- find [ 0 ] .save ()
1115+ find .mitigated = None
1116+ find .mitigated_by = None
1117+ find .active = True
1118+ find .verified = verified
1119+ find .save ()
11221120 note = Notes (entry = "Re-activated by %s re-upload." % scan_type ,
11231121 author = bundle .request .user )
11241122 note .save ()
1125- find [ 0 ] .notes .add (note )
1123+ find .notes .add (note )
11261124 reactivated_count += 1
1127- new_items .append (find [ 0 ] .id )
1125+ new_items .append (find .id )
11281126 else :
11291127 item .test = test
11301128 item .date = test .target_start
@@ -1137,6 +1135,16 @@ def obj_create(self, bundle, **kwargs):
11371135 finding_added_count += 1
11381136 new_items .append (item .id )
11391137 find = item
1138+
1139+ if hasattr (item , 'unsaved_req_resp' ) and len (item .unsaved_req_resp ) > 0 :
1140+ for req_resp in item .unsaved_req_resp :
1141+ burp_rr = BurpRawRequestResponse (finding = find ,
1142+ burpRequestBase64 = req_resp ["req" ],
1143+ burpResponseBase64 = req_resp ["resp" ],
1144+ )
1145+ burp_rr .clean ()
1146+ burp_rr .save ()
1147+
11401148 if item .unsaved_request is not None and item .unsaved_response is not None :
11411149 burp_rr = BurpRawRequestResponse (finding = find ,
11421150 burpRequestBase64 = item .unsaved_request ,
@@ -1153,6 +1161,7 @@ def obj_create(self, bundle, **kwargs):
11531161 query = endpoint .query ,
11541162 fragment = endpoint .fragment ,
11551163 product = test .engagement .product )
1164+ find .endpoints .add (ep )
11561165
11571166 if item .unsaved_tags is not None :
11581167 find .tags = item .unsaved_tags
0 commit comments