diff --git a/backend/audit/intakelib/checks/check_missing_award_numbers.py b/backend/audit/intakelib/checks/check_missing_award_numbers.py index b0173274a1..7cc93dc222 100644 --- a/backend/audit/intakelib/checks/check_missing_award_numbers.py +++ b/backend/audit/intakelib/checks/check_missing_award_numbers.py @@ -1,9 +1,11 @@ +from django.core.exceptions import ValidationError import logging from audit.intakelib.intermediate_representation import get_range_by_name from .util import get_message, build_cell_error_tuple logger = logging.getLogger(__name__) + # FIXME: We need comments on all the validations? def missing_award_numbers(ir): ars = get_range_by_name(ir, "award_reference") @@ -16,5 +18,6 @@ def missing_award_numbers(ir): ir, ars, index, get_message("check_missing_award_numbers") ) ) - - return errors + if len(errors) > 0: + logger.info("Raising a validation error.") + raise ValidationError(errors)