diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-28 09:07:46 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-28 09:07:46 +0700 |
| commit | 2179e0bad2e1d95f2c3e9e990cc58895e7878628 (patch) | |
| tree | f587c58e15440e5e9008b34e289b4e07ec51edcf /indoteknik_api/controllers/controller.py | |
| parent | 57d55f545da0fc501a9828bb3ca2988f126b241a (diff) | |
fix error syntax
Diffstat (limited to 'indoteknik_api/controllers/controller.py')
| -rw-r--r-- | indoteknik_api/controllers/controller.py | 3 |
1 files changed, 2 insertions, 1 deletions
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") |
