changeset 59:64403f1b424e

Make use of the new getNote methods on CVRFVulnerability
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 08 Oct 2014 11:38:44 +0200
parents fbc413b8a46e
children c6e7175ff28c
files farol/vulnerability.py
diffstat 1 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/farol/vulnerability.py	Wed Oct 08 11:34:11 2014 +0200
+++ b/farol/vulnerability.py	Wed Oct 08 11:38:44 2014 +0200
@@ -106,20 +106,15 @@
 @vulnerability.route('/<int:ordinal>/note/<int:note_ordinal>')
 @document_required
 def view_note(ordinal, note_ordinal):
-    for note in get_vuln(ordinal)._notes:
-        if note._ordinal != note_ordinal:
-            continue
-        return render_template('vulnerability/view_note.j2', note=note, ordinal=ordinal)
-    abort(404)
+    note = get_vuln(ordinal).getNote(note_ordinal)
+    if note is None:
+        abort(404)
+    return render_template('vulnerability/view_note.j2', note=note, ordinal=ordinal)
 
 @vulnerability.route('/<int:ordinal>/note/<int:note_ordinal>/edit', methods=['GET', 'POST'])
 @document_required
 def edit_note(ordinal, note_ordinal):
-    note = None
-    for n in get_vuln(ordinal)._notes:
-        if n._ordinal == note_ordinal:
-            note = n
-            break
+    note = get_vuln(ordinal).getNote(note_ordinal)
     if note is None:
         abort(404)
     if request.method != 'POST':

http://farol.wald.intevation.org