From 645475e459b61ef1bcb53ebdb4d60e694a072bb5 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Thu, 2 Sep 2021 12:39:57 +0200 Subject: [PATCH] Disable setting custom parameters of None or boolean type in web UI. Fixes #1870 --- locust/templates/index.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/locust/templates/index.html b/locust/templates/index.html index 6c7aba27d5..3fc4921987 100644 --- a/locust/templates/index.html +++ b/locust/templates/index.html @@ -80,8 +80,20 @@

Start new load test


{% if extra_options %}{% endif %} {% for key, value in extra_options.items() %} - -
+ {% if not ((value is none) or (value is boolean)) %} + +
+ {% endif %} + {% endfor %} + {% set glob={'header_printed': False} %} + {% for key, value in extra_options.items() %} + {% if (value is none) or (value is boolean) %} + {% if not glob.header_printed %} + The following custom parameters can't be set in the Web UI, because it is a boolean or None type:
+ {% set _ = glob.update({'header_printed':True}) %} + {% endif %} + {{key}}
+ {% endif %} {% endfor %}