task_order_id -> task_order_number
This commit is contained in:
parent
dd72c09a24
commit
a50b855389
@ -73,10 +73,10 @@ class BaseFinancialForm(ValidatedForm):
|
||||
return valid
|
||||
|
||||
@property
|
||||
def is_missing_task_order_id(self):
|
||||
def is_missing_task_order_number(self):
|
||||
return False
|
||||
|
||||
task_order_id = StringField(
|
||||
task_order_number = StringField(
|
||||
"Task Order Number associated with this request",
|
||||
description="Include the original Task Order number (including the 000X at the end). Do not include any modification numbers. Note that there may be a lag between approving a task order and when it becomes available in our system.",
|
||||
validators=[Required()]
|
||||
@ -125,15 +125,15 @@ class FinancialForm(BaseFinancialForm):
|
||||
del(kwargs["eda_client"])
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def validate_task_order_id(form, field):
|
||||
def validate_task_order_number(form, field):
|
||||
try:
|
||||
TaskOrders.get(field.data, client=form.eda_client)
|
||||
except NotFoundError:
|
||||
raise ValidationError("Task Order number not found")
|
||||
|
||||
@property
|
||||
def is_missing_task_order_id(self):
|
||||
return "task_order_id" in self.errors
|
||||
def is_missing_task_order_number(self):
|
||||
return "task_order_number" in self.errors
|
||||
|
||||
|
||||
class ExtendedFinancialForm(BaseFinancialForm):
|
||||
|
@ -16,7 +16,7 @@
|
||||
) }}
|
||||
{% endif %}
|
||||
|
||||
{% if f.is_missing_task_order_id %}
|
||||
{% if f.is_missing_task_order_number %}
|
||||
{% set extended_url = url_for('requests.financial_verification', request_id=request_id, extended=True) %}
|
||||
{{ Alert('Task Order not found in EDA',
|
||||
message="We could not find your Task Order in our system of record, EDA.
|
||||
@ -98,7 +98,7 @@
|
||||
{% endif %}
|
||||
|
||||
{{ TextInput(
|
||||
f.task_order_id,
|
||||
f.task_order_number,
|
||||
placeholder="e.g.: 1234567899C0001",
|
||||
tooltip="A Contracting Officer will likely be the best source for this number.",
|
||||
validation="anything"
|
||||
|
@ -15,9 +15,9 @@
|
||||
<h2 id="financial-verification">Financial Verification</h2>
|
||||
<p>In order to get you access to the JEDI Cloud, we will need you to enter the details below that will help us verify and account for your Task Order.</p>
|
||||
|
||||
{{ f.task_order_id.label }}
|
||||
{{ f.task_order_id(placeholder="Example: 1234567899C0001") }}
|
||||
{% for e in f.task_order_id.errors %}
|
||||
{{ f.task_order_number.label }}
|
||||
{{ f.task_order_number(placeholder="Example: 1234567899C0001") }}
|
||||
{% for e in f.task_order_number.errors %}
|
||||
<div class="usa-input-error-message">
|
||||
{{ e }}
|
||||
</div>
|
||||
|
@ -69,14 +69,14 @@ def test_ba_code_validation(input_, expected):
|
||||
|
||||
assert is_valid == expected
|
||||
|
||||
def test_task_order_id_validation():
|
||||
form_invalid = FinancialForm(data={"task_order_id": "1234"}, eda_client=MockEDAClient())
|
||||
def test_task_order_number_validation():
|
||||
form_invalid = FinancialForm(data={"task_order_number": "1234"}, eda_client=MockEDAClient())
|
||||
form_invalid.validate()
|
||||
|
||||
assert "task_order_id" in form_invalid.errors
|
||||
assert "task_order_number" in form_invalid.errors
|
||||
|
||||
form_valid = FinancialForm(data={"task_order_id": MockEDAClient.MOCK_CONTRACT_NUMBER}, eda_client=MockEDAClient())
|
||||
form_valid = FinancialForm(data={"task_order_number": MockEDAClient.MOCK_CONTRACT_NUMBER}, eda_client=MockEDAClient())
|
||||
form_valid.validate()
|
||||
|
||||
assert "task_order_id" not in form_valid.errors
|
||||
assert "task_order_number" not in form_valid.errors
|
||||
|
||||
|
@ -13,7 +13,7 @@ class TestPENumberInForm:
|
||||
|
||||
required_data = {
|
||||
"pe_id": "123",
|
||||
"task_order_id": MockEDAClient.MOCK_CONTRACT_NUMBER,
|
||||
"task_order_number": MockEDAClient.MOCK_CONTRACT_NUMBER,
|
||||
"fname_co": "Contracting",
|
||||
"lname_co": "Officer",
|
||||
"email_co": "jane@mail.mil",
|
||||
@ -103,7 +103,7 @@ class TestPENumberInForm:
|
||||
|
||||
data = dict(self.required_data)
|
||||
data['pe_id'] = MOCK_REQUEST.body['financial_verification']['pe_id']
|
||||
data['task_order_id'] = '1234'
|
||||
data['task_order_number'] = '1234'
|
||||
|
||||
response = self.submit_data(client, data)
|
||||
|
||||
@ -115,7 +115,7 @@ class TestPENumberInForm:
|
||||
|
||||
data = dict(self.required_data)
|
||||
data['pe_id'] = MOCK_REQUEST.body['financial_verification']['pe_id']
|
||||
data['task_order_id'] = MockEDAClient.MOCK_CONTRACT_NUMBER
|
||||
data['task_order_number'] = MockEDAClient.MOCK_CONTRACT_NUMBER
|
||||
|
||||
response = self.submit_data(client, data)
|
||||
|
||||
@ -127,7 +127,7 @@ class TestPENumberInForm:
|
||||
|
||||
data = { **self.required_data, **self.extended_data }
|
||||
data['pe_id'] = MOCK_REQUEST.body['financial_verification']['pe_id']
|
||||
data['task_order_id'] = "1234567"
|
||||
data['task_order_number'] = "1234567"
|
||||
|
||||
response = self.submit_data(client, data, extended=True)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user