diff --git a/atst/forms/fields.py b/atst/forms/fields.py index 042e43bd..c69c8ed6 100644 --- a/atst/forms/fields.py +++ b/atst/forms/fields.py @@ -1,4 +1,4 @@ -from wtforms.fields import Field, SelectField as SelectField_ +from wtforms.fields import Field, StringField, SelectField as SelectField_ from wtforms.widgets import TextArea @@ -31,3 +31,11 @@ class SelectField(SelectField_): render_kw = kwargs.get("render_kw", {}) kwargs["render_kw"] = {**render_kw, "required": False} super().__init__(*args, **kwargs) + + +class NumberStringField(StringField): + def process_data(self, value): + if isinstance(value, int): + self.data = str(value) + else: + self.data = value diff --git a/atst/forms/financial.py b/atst/forms/financial.py index afc6f3d0..8ff2156b 100644 --- a/atst/forms/financial.py +++ b/atst/forms/financial.py @@ -9,7 +9,7 @@ from atst.domain.exceptions import NotFoundError from atst.domain.pe_numbers import PENumbers from atst.domain.task_orders import TaskOrders -from .fields import NewlineListField, SelectField +from .fields import NewlineListField, SelectField, NumberStringField from .forms import ValidatedForm from .data import FUNDING_TYPES from .validators import DateRange @@ -182,42 +182,42 @@ class ExtendedFinancialForm(BaseFinancialForm): format="%m/%d/%Y", ) - clin_0001 = StringField( + clin_0001 = NumberStringField( "
CLIN 0001
-
Unclassified IaaS and PaaS Amount
", validators=[InputRequired()], description="Review your task order document, the amounts for each CLIN must match exactly here", filters=[number_to_int], ) - clin_0003 = StringField( + clin_0003 = NumberStringField( "
CLIN 0003
-
Unclassified Cloud Support Package
", validators=[InputRequired()], description="Review your task order document, the amounts for each CLIN must match exactly here", filters=[number_to_int], ) - clin_1001 = StringField( + clin_1001 = NumberStringField( "
CLIN 1001
-
Unclassified IaaS and PaaS Amount
OPTION PERIOD 1
", validators=[InputRequired()], description="Review your task order document, the amounts for each CLIN must match exactly here", filters=[number_to_int], ) - clin_1003 = StringField( + clin_1003 = NumberStringField( "
CLIN 1003
-
Unclassified Cloud Support Package
OPTION PERIOD 1
", validators=[InputRequired()], description="Review your task order document, the amounts for each CLIN must match exactly here", filters=[number_to_int], ) - clin_2001 = StringField( + clin_2001 = NumberStringField( "
CLIN 2001
-
Unclassified IaaS and PaaS Amount
OPTION PERIOD 2
", validators=[InputRequired()], description="Review your task order document, the amounts for each CLIN must match exactly here", filters=[number_to_int], ) - clin_2003 = StringField( + clin_2003 = NumberStringField( "
CLIN 2003
-
Unclassified Cloud Support Package
OPTION PERIOD 2
", validators=[InputRequired()], description="Review your task order document, the amounts for each CLIN must match exactly here",