summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2023-12-11 13:26:34 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2023-12-11 13:34:25 +0100
commitc1548fd21993eb4cdfdbcabc13c5761db935e35f (patch)
treed3d79eedd8ef10b6561f2b19533d0e257f9b889d /ogcp/views.py
parentcc5c0105dbf11bfffd6f439181326a841bbeb27d (diff)
views: Check form contain a cache partition
Make the partition and format form fail if the user has not added a cache partition. A cache partition is required to make the restoration of images work
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 7c50ac9..6ad9918 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -557,6 +557,14 @@ def action_setup_show():
def action_setup_modify():
form = SetupForm(request.form)
if form.validate():
+ has_cache=False
+ for partition in form.partitions:
+ if partition.part_type.data == 'CACHE':
+ has_cache=True
+ if not has_cache:
+ flash(_(f'Missing cache partition'), category='error')
+ return redirect(url_for('commands'))
+
ips = form.ips.data.split(' ')
payload = {'clients': ips,