summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-11-08 13:25:47 +0100
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-11-17 17:36:15 +0100
commitd029df8e842f8dce9d48f8ec9e11e336b0af46e9 (patch)
tree188406a18c432c79ea3b927a787ddef1e1a180fd /ogcp/views.py
parentfc02d891cd4b23578d609162f1c7dbbc429be08f (diff)
Show warning when formatting clients without disksv1.1.2
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.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py3
1 files changed, 3 insertions, 0 deletions
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]