Mercurial > farol > farol
diff farol/vulnerability.py @ 93:8e72f31d7392
Add deletion of Threats
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Thu, 09 Oct 2014 16:14:25 +0200 |
parents | 33d6fd9a5e12 |
children | 1ca989387aeb |
line wrap: on
line diff
--- a/farol/vulnerability.py Thu Oct 09 16:08:45 2014 +0200 +++ b/farol/vulnerability.py Thu Oct 09 16:14:25 2014 +0200 @@ -337,6 +337,17 @@ threat.addGroupID(groupid) return redirect(url_for('.view', ordinal=ordinal)) +@vulnerability.route('/<int:ordinal>/threat/<int:index>/del', methods=['POST']) +@document_required +def del_threat(ordinal, index): + threats = get_vuln(ordinal)._threats + if not (0 <= index < len(threats)): + flash('Threat not found', 'danger') + abort(404) + + del threats[index] + return redirect(url_for('.view', ordinal=ordinal)) + @vulnerability.route('/<int:ordinal>/cvss/<int:index>') @document_required