Merge pull request #365 from dod-ccpo/reduce-alerts-on-financial-form

Reduce alerts on financial form
This commit is contained in:
patricksmithdds 2018-10-02 12:38:43 -04:00 committed by GitHub
commit f47255ee91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View File

@ -151,6 +151,10 @@ class FinancialForm(BaseFinancialForm):
def is_missing_task_order_number(self): def is_missing_task_order_number(self):
return "task_order_number" in self.errors return "task_order_number" in self.errors
@property
def is_only_missing_task_order_number(self):
return "task_order_number" in self.errors and len(self.errors) == 1
class ExtendedFinancialForm(BaseFinancialForm): class ExtendedFinancialForm(BaseFinancialForm):
def validate(self, *args, **kwargs): def validate(self, *args, **kwargs):

View File

@ -9,7 +9,7 @@
{% include 'requests/review_menu.html' %} {% include 'requests/review_menu.html' %}
{% if request.is_pending_financial_verification %} {% if request.is_pending_financial_verification and not f.errors and not extended %}
{{ Alert('Pending Financial Verification', fragment="fragments/pending_financial_verification.html") }} {{ Alert('Pending Financial Verification', fragment="fragments/pending_financial_verification.html") }}
{% endif %} {% endif %}
@ -21,9 +21,16 @@
<div class="col"> <div class="col">
{% if extended %} {% if extended %}
{{ Alert('Task Order not found in EDA', {{ Alert('Manually enter Task Order information',
message="We could not find your Task Order in the EDA, our system of record. Please confirm that you have entered the information correctly and resubmit or click on the button below to enter the TO manually.", message="Additional fields are displayed below, where you can manually enter financial information as documented in your Task Order.",
level='warning' level='warning',
actions=[
{
'href': url_for('atst.helpdocs'),
'label': 'Learn more about the JEDI Cloud Task Order and the Financial Verification process.',
'icon': 'help'
}
]
) }} ) }}
{% endif %} {% endif %}
@ -47,7 +54,7 @@
{% block form %} {% block form %}
{% autoescape false %} {% autoescape false %}
{% if f.errors %} {% if f.errors and not f.is_only_missing_task_order_number %}
{{ Alert('There were some errors', {{ Alert('There were some errors',
message="<p>Please see below.</p>", message="<p>Please see below.</p>",
level='error' level='error'