From 3e7913ef03dc46a902f14d29e00c92eaed6bdf9d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 17 May 2023 14:21:27 +0700 Subject: Fix error edit address, delete delivery line sale order api --- indoteknik_api/controllers/controller.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indoteknik_api/controllers/controller.py') 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'] -- cgit v1.2.3