From d2fef8e85dcd348201631911711cbb9b5db30ec3 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Wed, 6 Apr 2022 17:28:42 +0200 Subject: Move search_image() outside action_image_restore() --- ogcp/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ogcp') diff --git a/ogcp/views.py b/ogcp/views.py index 2f2e01d..ef85f05 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -457,15 +457,15 @@ def action_setup_modify(): flash(_(f'Invalid setup form'), category='error') return redirect(url_for('commands')) +def search_image(images_list, image_id): + for image in images_list: + if image['id'] == image_id: + return image + return False + @app.route('/action/image/restore', methods=['GET', 'POST']) @login_required def action_image_restore(): - def search_image(images_list, image_id): - for image in images_list: - if image['id'] == image_id: - return image - return False - form = ImageRestoreForm(request.form) if request.method == 'POST': ips = form.ips.data.split(' ') -- cgit v1.2.3-18-g5258