summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 77402d6..c756ac9 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -642,14 +642,18 @@ def action_setup_show():
def action_setup_modify():
form = SetupForm(request.form)
if form.validate():
- has_cache=False
+ cache_count = 0
for partition in form.partitions:
if partition.part_type.data == 'CACHE':
- has_cache=True
- if not has_cache:
+ cache_count += 1
+ if cache_count == 0:
flash(_(f'Missing cache partition'), category='error')
return redirect(url_for('commands'))
+ if cache_count > 1:
+ flash(_(f'More than one cache partition is not supported'), category='error')
+ return redirect(url_for('commands'))
+
ips = form.ips.data.split(' ')
payload = {'clients': ips,