From b3b19dc136fa5708d9978c44a4a778083e103971 Mon Sep 17 00:00:00 2001 From: tedder Date: Thu, 25 Jan 2018 07:33:38 -0800 Subject: [PATCH] add 'True' as a string as a boolean This allows pythonic API clients to pass boolean values in: requests.get('/api/printer', params={'history': True}) Previously this didn't work, as Octoprint doesn't see True as a boolean, it gets a sting. So it never matches True, it only matches "True". Easy to test: curl -H "X-Api-Key: x" http://octopi.local/api/printer?history=true | grep history curl -H "X-Api-Key: x" http://octopi.local/api/printer?history=True | grep history --- src/octoprint/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index f8e5b09dc..8df4ffa71 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -405,7 +405,7 @@ default_settings = { } """The default settings of the core application.""" -valid_boolean_trues = [True, "true", "yes", "y", "1"] +valid_boolean_trues = [True, "True", "true", "yes", "y", "1"] """ Values that are considered to be equivalent to the boolean ``True`` value, used for type conversion in various places."""