Update funding form to handle uploading pdf/png

This commit is contained in:
Patrick Smith
2019-01-21 15:55:37 -05:00
parent 2298c5135e
commit 6a9290619d
7 changed files with 43 additions and 14 deletions

View File

@@ -11,6 +11,7 @@ from wtforms.fields import (
from wtforms.fields.html5 import DateField, TelField
from wtforms.widgets import ListWidget, CheckboxInput
from wtforms.validators import Length
from flask_wtf.file import FileAllowed
from atst.forms.validators import IsNumber, PhoneNumber, RequiredIf
@@ -86,9 +87,14 @@ class FundingForm(CacheableForm):
end_date = DateField(
translate("forms.task_order.end_date_label"), format="%m/%d/%Y"
)
pdf = FileField(
translate("forms.task_order.pdf_label"),
description=translate("forms.task_order.pdf_description"),
csp_estimate = FileField(
translate("forms.task_order.csp_estimate_label"),
description=translate("forms.task_order.csp_estimate_description"),
validators=[
FileAllowed(
["pdf", "png"], translate("forms.task_order.file_format_not_allowed")
)
],
)
clin_01 = IntegerField(translate("forms.task_order.clin_01_label"))
clin_02 = IntegerField(translate("forms.task_order.clin_02_label"))