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
master
Javier Hernandez 2023-12-11 13:26:34 +01:00 committed by OpenGnSys Support Team
parent cc5c0105db
commit c1548fd219
1 changed files with 8 additions and 0 deletions

View File

@ -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,