# HG changeset patch # User BenoƮt Allard # Date 1412865123 -7200 # Node ID 3848faa88cd5bbc1c6eabf91ad85fe003e824ca8 # Parent 0b64dc3f50eb9b40e1c1c2a85b66d942a3969942 Add deletion of Vulnerability's References diff -r 0b64dc3f50eb -r 3848faa88cd5 farol/templates/vulnerability/view.j2 --- a/farol/templates/vulnerability/view.j2 Thu Oct 09 16:26:55 2014 +0200 +++ b/farol/templates/vulnerability/view.j2 Thu Oct 09 16:32:03 2014 +0200 @@ -109,7 +109,7 @@ {% call panel(heading="References", badge=vulnerability._references | length , title=3) %} add diff -r 0b64dc3f50eb -r 3848faa88cd5 farol/vulnerability.py --- a/farol/vulnerability.py Thu Oct 09 16:26:55 2014 +0200 +++ b/farol/vulnerability.py Thu Oct 09 16:32:03 2014 +0200 @@ -512,6 +512,17 @@ get_vuln(ordinal).addReference(ref) return redirect(url_for('.view', ordinal=ordinal)) +@vulnerability.route('//reference//del', methods=['POST']) +@document_required +def del_reference(ordinal, index): + refs = get_vuln(ordinal)._references + if not ( 0 <= index < len(refs)): + flash('Reference not found', 'danger') + abort(404) + + del refs[index] + return redirect(url_for('.view', ordinal=ordinal)) + @vulnerability.route('//acknowledgment/') @document_required