summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-04-06 17:28:42 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-04-08 08:03:10 +0200
commitd2fef8e85dcd348201631911711cbb9b5db30ec3 (patch)
treef0b643b5c523905693b740efee2a0be70a2b9768
parent4c9c3b48db02bcc27a89da694cd9ef5aad1c14c5 (diff)
Move search_image() outside action_image_restore()
-rw-r--r--ogcp/views.py12
1 files changed, 6 insertions, 6 deletions
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(' ')