@@ -1251,6 +1251,7 @@ def close_finding(request, fid):
1251
1251
form .cleaned_data .get ("mitigated_by" ) or request .user
1252
1252
)
1253
1253
finding .is_mitigated = True
1254
+ finding .under_review = False
1254
1255
finding .last_reviewed = finding .mitigated
1255
1256
finding .last_reviewed_by = request .user
1256
1257
finding .false_p = form .cleaned_data .get ("false_p" , False )
@@ -1265,6 +1266,8 @@ def close_finding(request, fid):
1265
1266
status .mitigated = True
1266
1267
status .last_modified = timezone .now ()
1267
1268
status .save ()
1269
+ # Clear the risk acceptance, if present
1270
+ ra_helper .risk_unaccept (finding )
1268
1271
1269
1272
# Manage the jira status changes
1270
1273
push_to_jira = False
@@ -1431,13 +1434,16 @@ def reopen_finding(request, fid):
1431
1434
finding .is_mitigated = False
1432
1435
finding .last_reviewed = finding .mitigated
1433
1436
finding .last_reviewed_by = request .user
1437
+ finding .under_review = False
1434
1438
endpoint_status = finding .status_finding .all ()
1435
1439
for status in endpoint_status :
1436
1440
status .mitigated_by = None
1437
1441
status .mitigated_time = None
1438
1442
status .mitigated = False
1439
1443
status .last_modified = timezone .now ()
1440
1444
status .save ()
1445
+ # Clear the risk acceptance, if present
1446
+ ra_helper .risk_unaccept (finding )
1441
1447
1442
1448
# Manage the jira status changes
1443
1449
push_to_jira = False
@@ -1759,6 +1765,9 @@ def clear_finding_review(request, fid):
1759
1765
1760
1766
finding = form .save (commit = False )
1761
1767
1768
+ if finding .is_mitigated :
1769
+ finding .mitigated = now
1770
+ finding .mitigated_by = request .user
1762
1771
finding .under_review = False
1763
1772
finding .last_reviewed = now
1764
1773
finding .last_reviewed_by = request .user
0 commit comments