show or hide manual TO fields based on query param

This commit is contained in:
dandds
2018-08-20 15:51:32 -04:00
parent a574734a8b
commit 735b9b5179
4 changed files with 79 additions and 59 deletions

View File

@@ -57,12 +57,7 @@ def validate_pe_id(field, existing_request):
return True
class FinancialForm(ValidatedForm):
def validate(self, *args, **kwargs):
if self.funding_type.data == "OTHER":
self.funding_type_other.validators.append(Required())
return super().validate(*args, **kwargs)
class BaseFinancialForm(ValidatedForm):
def reset(self):
"""
Reset UII info so that it can be de-parsed rendered properly.
@@ -117,6 +112,17 @@ class FinancialForm(ValidatedForm):
"Contracting Officer Representative (COR) Office", validators=[Required()]
)
class FinancialForm(BaseFinancialForm):
pass
class ExtendedFinancialForm(BaseFinancialForm):
def validate(self, *args, **kwargs):
if self.funding_type.data == "OTHER":
self.funding_type_other.validators.append(Required())
return super().validate(*args, **kwargs)
funding_type = SelectField(
description="What is the source of funding?",
choices=[