From 0a6cbe7e039bc2e39014e044eed94ce27524c8f4 Mon Sep 17 00:00:00 2001 From: dandds Date: Tue, 21 Aug 2018 09:22:39 -0400 Subject: [PATCH] warning alert for manually entering task order info on financial form --- .gitignore | 1 + atst/forms/financial.py | 8 ++++++++ templates/requests/financial_verification.html | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/.gitignore b/.gitignore index 6afb33d1..7f2755cc 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ config/dev.ini # CRLs /crl /crl-tmp +*.bk diff --git a/atst/forms/financial.py b/atst/forms/financial.py index bb55896d..1724446f 100644 --- a/atst/forms/financial.py +++ b/atst/forms/financial.py @@ -72,6 +72,10 @@ class BaseFinancialForm(ValidatedForm): valid = validate_pe_id(self.pe_id, existing_request) return valid + @property + def is_missing_task_order_id(self): + return False + task_order_id = 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.", @@ -127,6 +131,10 @@ class FinancialForm(BaseFinancialForm): except NotFoundError: raise ValidationError("Task Order number not found") + @property + def is_missing_task_order_id(self): + return "task_order_id" in self.errors + class ExtendedFinancialForm(BaseFinancialForm): def validate(self, *args, **kwargs): diff --git a/templates/requests/financial_verification.html b/templates/requests/financial_verification.html index 2f037d31..225590de 100644 --- a/templates/requests/financial_verification.html +++ b/templates/requests/financial_verification.html @@ -16,6 +16,17 @@ ) }} {% endif %} + {% if f.is_missing_task_order_id %} + {% 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. + Please confirm that you have entered it correctly. + Otherwise enter TO information manually. + "|format(extended_url), + level='warning' + ) }} + {% endif %} +