Added the strip_form() utility to the Mia core application, and apply it to the transaction_store() view of the accounting application.

This commit is contained in:
2020-07-31 00:14:12 +08:00
parent 69e8eed33f
commit 1a27d87400
2 changed files with 13 additions and 1 deletions

View File

@ -43,6 +43,16 @@ def new_pk(cls):
return id
def strip_form(form):
"""Strips the values of a form. Empty strings are converted to None.
Args:
form (dict[str]): The form.
"""
for key in form.keys():
form[key] = form[key].strip()
class Language:
"""A language.