Skip to content

Commit ebdc18e

Browse files
committed
More changes fixing the re-import scan functionality.
1 parent f1f2192 commit ebdc18e

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

dojo/test/views.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -438,19 +438,20 @@ def re_import_scan_results(request, tid):
438438
)
439439

440440
if len(find) == 1:
441-
if find[0].mitigated:
441+
find = find[0]
442+
if find.mitigated:
442443
# it was once fixed, but now back
443-
find[0].mitigated = None
444-
find[0].mitigated_by = None
445-
find[0].active = True
446-
find[0].verified = verified
447-
find[0].save()
444+
find.mitigated = None
445+
find.mitigated_by = None
446+
find.active = True
447+
find.verified = verified
448+
find.save()
448449
note = Notes(entry="Re-activated by %s re-upload." % scan_type,
449450
author=request.user)
450451
note.save()
451-
find[0].notes.add(note)
452+
find.notes.add(note)
452453
reactivated_count += 1
453-
new_items.append(find[0].id)
454+
new_items.append(find.id)
454455
else:
455456
item.test = t
456457
item.date = t.target_start
@@ -466,7 +467,7 @@ def re_import_scan_results(request, tid):
466467

467468
if hasattr(item, 'unsaved_req_resp') and len(item.unsaved_req_resp) > 0:
468469
for req_resp in item.unsaved_req_resp:
469-
burp_rr = BurpRawRequestResponse(finding=item,
470+
burp_rr = BurpRawRequestResponse(finding=find,
470471
burpRequestBase64=req_resp["req"],
471472
burpResponseBase64=req_resp["resp"],
472473
)
@@ -489,7 +490,7 @@ def re_import_scan_results(request, tid):
489490
query=endpoint.query,
490491
fragment=endpoint.fragment,
491492
product=t.engagement.product)
492-
item.endpoints.add(ep)
493+
find.endpoints.add(ep)
493494

494495
if item.unsaved_tags is not None:
495496
find.tags = item.unsaved_tags

0 commit comments

Comments
 (0)