Update funding form to handle uploading pdf/png
This commit is contained in:
@@ -8,7 +8,7 @@ from atst.domain.exceptions import UploadError
|
||||
|
||||
|
||||
class FileProviderInterface:
|
||||
_PERMITTED_MIMETYPES = ["application/pdf"]
|
||||
_PERMITTED_MIMETYPES = ["application/pdf", "image/png"]
|
||||
|
||||
def _enforce_mimetype(self, fyle):
|
||||
# TODO: for hardening, we should probably use a better library for
|
||||
|
@@ -25,7 +25,7 @@ class TaskOrders(object):
|
||||
],
|
||||
"funding": [
|
||||
"performance_length",
|
||||
# "pdf",
|
||||
"csp_estimate",
|
||||
"clin_01",
|
||||
"clin_02",
|
||||
"clin_03",
|
||||
|
@@ -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"))
|
||||
|
Reference in New Issue
Block a user