From d029df8e842f8dce9d48f8ec9e11e336b0af46e9 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 8 Nov 2022 13:25:47 +0100 Subject: 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. --- ogcp/views.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ogcp') diff --git a/ogcp/views.py b/ogcp/views.py index 2edcbc2..0a65c17 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -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] -- cgit v1.2.3-18-g5258