Show warning when formatting clients without disks

If an administrator selects a client without disks and goes to
"Partition & Format", ogCP redirects it again to "Commands" and shows a
floating message indicating that the client has no disks.
async-tree v1.1.2
Javier Sánchez Parra 2022-11-08 13:25:47 +01:00
parent fc02d891cd
commit d029df8e84
1 changed files with 3 additions and 0 deletions

View File

@ -515,6 +515,9 @@ def action_setup_show():
base_client = args['selected_client']
db_partitions = get_client_setup(base_client)
if not db_partitions:
flash(_('Selected client has no disks'), category='error')
return redirect(url_for('commands'))
filtered_partitions = [p for p in db_partitions
if p.get('disk') == selected_disk]