summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-05 10:58:22 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-05 11:31:11 +0200
commitacd6d20eeb0428ddb97b87471dfc66e2fec6945f (patch)
tree26d87c3cd54562102ccc27e1c56f9b28f834ad4f /ogcp/views.py
parent4c97b671aaa00049a2dee88038a918f82ced1c83 (diff)
views: Prevent zero or negative size partitions
Defining a partition size <1 causes the partition to show with a different configuration to the one configured in the form. Any <1 size partition shows as Linux, Empty and the size field without value. Validate the form so we refuse any partition with size <1.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 16e39b6..dc8d3d0 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -653,6 +653,10 @@ def action_setup_modify():
flash(_('The EFI partition requires a FAT32 filesystem'), category='error')
return redirect(url_for('commands'))
+ if partition.size.data <= 0:
+ flash(_('Partitions can\'t have a size of zero or lower'), category='error')
+ return redirect(url_for('commands'))
+
if cache_count == 0:
flash(_(f'Missing cache partition'), category='error')
return redirect(url_for('commands'))