diff farol/document.py @ 74:80cd8f65e72b

Add deletion of Acknowledgments
author Benoît Allard <benoit.allard@greenbone.net>
date Thu, 09 Oct 2014 11:17:19 +0200
parents 88adf067cae1
children 5535ac5fef37
line wrap: on
line diff
--- a/farol/document.py	Thu Oct 09 11:14:50 2014 +0200
+++ b/farol/document.py	Thu Oct 09 11:17:19 2014 +0200
@@ -292,3 +292,13 @@
     ack = create_acknowledgment_from_request()
     get_current().addAcknowledgment(ack)
     return redirect(url_for('.view'))
+
+@document.route('/acknowledgment/<int:index>/del', methods=['POST'])
+@document_required
+def del_acknowledgment(index):
+    acks = get_current()._acknowledgments
+    if not( 0 <= index < len(acks)):
+        flash('Acknowledgment not found', 'danger')
+        abort(404)
+    del acks[index]
+    return redirect(url_for('.view'))

http://farol.wald.intevation.org