Mercurial > farol > farol
comparison farol/document.py @ 64:aad7db3f93b6
Add support for Acknowledgments with multiple names and organizations
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Wed, 08 Oct 2014 14:28:29 +0200 |
parents | b4fb652484b4 |
children | f1705e90695b |
comparison
equal
deleted
inserted
replaced
63:b4fb652484b4 | 64:aad7db3f93b6 |
---|---|
238 try: | 238 try: |
239 ack = get_current()._acknowledgments[index] | 239 ack = get_current()._acknowledgments[index] |
240 except IndexError: | 240 except IndexError: |
241 abort(404) | 241 abort(404) |
242 if request.method != 'POST': | 242 if request.method != 'POST': |
243 return render_template('document/edit_acknowledgment.j2', name=ack._name, organization=ack._organization, description=ack._description, url=ack._url, action='Update') | 243 return render_template('document/edit_acknowledgment.j2', |
244 names=ack._names, organizations=ack._organizations, | |
245 description=ack._description, url=ack._url, | |
246 action='Update') | |
244 | 247 |
245 update_acknowledgment_from_request(ack) | 248 update_acknowledgment_from_request(ack) |
246 return redirect(url_for('.view')) | 249 return redirect(url_for('.view')) |
247 | 250 |
248 @document.route('/acknowledgment/add', methods=['GET', 'POST']) | 251 @document.route('/acknowledgment/add', methods=['GET', 'POST']) |
249 @document_required | 252 @document_required |
250 def add_acknowledgment(): | 253 def add_acknowledgment(): |
251 if request.method != 'POST': | 254 if request.method != 'POST': |
252 return render_template('document/edit_acknowledgment.j2', action='Add') | 255 return render_template('document/edit_acknowledgment.j2', |
256 action='Add') | |
253 | 257 |
254 ack = create_acknowledgment_from_request() | 258 ack = create_acknowledgment_from_request() |
255 get_current().addAcknowledgment(ack) | 259 get_current().addAcknowledgment(ack) |
256 return redirect(url_for('.view')) | 260 return redirect(url_for('.view')) |