From 2179e0bad2e1d95f2c3e9e990cc58895e7878628 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 28 Apr 2023 09:07:46 +0700 Subject: fix error syntax --- indoteknik_api/controllers/controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indoteknik_api/controllers/controller.py') diff --git a/indoteknik_api/controllers/controller.py b/indoteknik_api/controllers/controller.py index 5b20f7d4..d4afb672 100644 --- a/indoteknik_api/controllers/controller.py +++ b/indoteknik_api/controllers/controller.py @@ -76,7 +76,8 @@ class Controller(http.Controller): 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) - if (value := kw.get(key, '')) in ['null', 'undefined']: + value = kw.get(key, '') + if value in ['null', 'undefined']: value = '' if 'required' in rules and not value: result['reason'].append(f"{key} is required") -- cgit v1.2.3