From 1cf6fbc49ec4b65599483ab7bdeace912665424e Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 13 Feb 2025 14:52:27 +0100 Subject: [PATCH] views: remove rendundant partition checks in image/restore Partition validation is already performed before the removed checks image restore, additional checks are redundant. Remove redundant partition validation. --- ogcp/views.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ogcp/views.py b/ogcp/views.py index 53acbd8..5040bd3 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1112,10 +1112,6 @@ def action_image_restore(): reference_patitioning = part_collection.get_partition_setup(0) - if not reference_patitioning: - flash(_(f'No valid partition found'), category='error') - return redirect(url_for('commands')) - for disk_id, part_id, part_type, fs_type, part_size in reference_patitioning: form.partition.choices.append( (f"{disk_id} {part_id} {part_size} {has_cache}", @@ -1124,10 +1120,6 @@ def action_image_restore(): f"{fs_type}") ) - if not form.partition.choices: - flash(_(f'No valid partition available'), category='error') - return redirect(url_for('commands')) - return render_template('actions/image_restore.html', form=form, selected_clients=selected_clients, scopes=scopes)