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
This commit is contained in:
1 parent
9f1abee023
commit
b3b19dc136
1 file changed
+1
-1
@@ -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."""
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user