Apply PENumber error message
This commit is contained in:
parent
f763c0ef6e
commit
2e98ff2240
@ -27,6 +27,7 @@ class PENumberValidator(object):
|
|||||||
try:
|
try:
|
||||||
PENumbers.get(field.data)
|
PENumbers.get(field.data)
|
||||||
except NotFoundError:
|
except NotFoundError:
|
||||||
|
self._apply_error(field)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
@ -50,7 +51,7 @@ class PENumberValidator(object):
|
|||||||
return request.pe_number == pe_id
|
return request.pe_number == pe_id
|
||||||
|
|
||||||
def _apply_error(self, field):
|
def _apply_error(self, field):
|
||||||
suggestion = self.pe_validator.suggest_pe_id(field.data)
|
suggestion = self.suggest_pe_id(field.data)
|
||||||
error_str = (
|
error_str = (
|
||||||
"We couldn't find that PE number. {}"
|
"We couldn't find that PE number. {}"
|
||||||
"If you have double checked it you can submit anyway. "
|
"If you have double checked it you can submit anyway. "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user