From fe8dae191eb6cd0179047557e7d04bdf8ac0374d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 2 Aug 2020 09:44:08 +0800 Subject: [PATCH] Revised the strip_form() utility to remove the empty input in the Mia core application. --- mia_core/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mia_core/utils.py b/mia_core/utils.py index cf5b610..f3ee0d6 100644 --- a/mia_core/utils.py +++ b/mia_core/utils.py @@ -49,8 +49,10 @@ def strip_form(form): Args: form (dict[str]): The form. """ - for key in form.keys(): + for key in list(form.keys()): form[key] = form[key].strip() + if form[key] == "": + del form[key] class Language: