Add helper to cast API parameter true to bool

This commit is contained in:
JonnyWong16 2020-02-22 22:33:49 -08:00
parent 37d09e9bad
commit 9edbe6af37
4 changed files with 29 additions and 21 deletions

View file

@ -1260,6 +1260,14 @@ def mask_config_passwords(config):
return config
def bool_true(value):
if value is True:
return True
elif isinstance(value, basestring) and value.lower() in ('1', 'true', 't', 'yes', 'y', 'on'):
return True
return False
def page(endpoint, *args, **kwargs):
endpoints = {
'pms_image_proxy': pms_image_proxy,