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:
@ -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.
|
||||
|
||||
|
Reference in New Issue
Block a user