diff options
Diffstat (limited to 'indoteknik_api/controllers/controller.py')
| -rw-r--r-- | indoteknik_api/controllers/controller.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/controller.py b/indoteknik_api/controllers/controller.py index b850bdde..90bc50ed 100644 --- a/indoteknik_api/controllers/controller.py +++ b/indoteknik_api/controllers/controller.py @@ -73,6 +73,7 @@ class Controller(http.Controller): for key, rules in queries.items(): is_number = 'number' in rules + is_exclude_if_null = 'exclude_if_null' in rules alias = next((r.replace('alias:', '') for r in rules if r.startswith('alias:')), key) default = next((r.replace('default:', '') for r in rules if r.startswith('default:')), None) @@ -91,6 +92,9 @@ class Controller(http.Controller): if is_number and value.isdigit(): value = int(value) + if not value and is_exclude_if_null: + continue + result['value'][alias] = value result['valid'] = not result['reason'] |
