Move removing empty items in a list field to CacheableForm

This commit is contained in:
leigh-mil
2019-02-27 11:37:39 -05:00
parent 7b41b8e94c
commit e00e24f083
3 changed files with 10 additions and 20 deletions

View File

@@ -15,8 +15,6 @@ class ApplicationForm(FlaskForm):
class NewApplicationForm(ApplicationForm):
EMPTY_ENVIRONMENT_NAMES = ["", None]
environment_names = FieldList(
StringField(label=translate("forms.application.environment_names_label")),
validators=[
@@ -32,13 +30,3 @@ class NewApplicationForm(ApplicationForm):
),
],
)
@property
def data(self):
_data = super(FlaskForm, self).data
_data["environment_names"] = [
n
for n in _data["environment_names"]
if n not in self.EMPTY_ENVIRONMENT_NAMES
]
return _data