Cleanup
This commit is contained in:
parent
6345a06e54
commit
f763c0ef6e
@ -88,20 +88,6 @@ class FinancialVerificationBase(object):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _apply_pe_number_error(self, field):
|
|
||||||
suggestion = self.pe_validator.suggest_pe_id(field.data)
|
|
||||||
error_str = (
|
|
||||||
"We couldn't find that PE number. {}"
|
|
||||||
"If you have double checked it you can submit anyway. "
|
|
||||||
"Your request will need to go through a manual review."
|
|
||||||
).format('Did you mean "{}"? '.format(suggestion) if suggestion else "")
|
|
||||||
field.errors += (error_str,)
|
|
||||||
field.errors = list(field.errors)
|
|
||||||
|
|
||||||
def _apply_task_order_number_error(self, field):
|
|
||||||
field.errors += ("Task Order number not found",)
|
|
||||||
field.errors = list(field.errors)
|
|
||||||
|
|
||||||
def _raise(self, form):
|
def _raise(self, form):
|
||||||
form.reset()
|
form.reset()
|
||||||
raise FormValidationError(form)
|
raise FormValidationError(form)
|
||||||
@ -191,7 +177,9 @@ class SaveFinancialVerificationDraft(FinancialVerificationBase):
|
|||||||
if not self.pe_validator.validate(self.request, form.pe_id):
|
if not self.pe_validator.validate(self.request, form.pe_id):
|
||||||
valid = False
|
valid = False
|
||||||
|
|
||||||
if form.task_order.number.data and not self.task_order_validator.validate(form.task_order.number):
|
if form.task_order.number.data and not self.task_order_validator.validate(
|
||||||
|
form.task_order.number
|
||||||
|
):
|
||||||
valid = False
|
valid = False
|
||||||
|
|
||||||
attachment = self._process_attachment(self.is_extended, form)
|
attachment = self._process_attachment(self.is_extended, form)
|
||||||
|
@ -328,7 +328,9 @@ def test_get_fv_form_route(client, user_session, fv_data):
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
|
||||||
def test_manual_task_order_triggers_extended_form(client, user_session, fv_data, e_fv_data):
|
def test_manual_task_order_triggers_extended_form(
|
||||||
|
client, user_session, fv_data, e_fv_data
|
||||||
|
):
|
||||||
user = UserFactory.create()
|
user = UserFactory.create()
|
||||||
request = RequestFactory.create(creator=user)
|
request = RequestFactory.create(creator=user)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user