diff --git a/app/validators/answers/number_answer_validator.py b/app/validators/answers/number_answer_validator.py index a7f1d046..c99e9258 100644 --- a/app/validators/answers/number_answer_validator.py +++ b/app/validators/answers/number_answer_validator.py @@ -70,7 +70,7 @@ def validate_value_in_limits(self): answer_ranges = self.questionnaire_schema.numeric_answer_ranges referred_answer = ( self.questionnaire_schema.get_numeric_value_for_value_source( - min_value, answer_ranges + value_source=min_value, answer_ranges=answer_ranges ) ) if referred_answer["min"] < MIN_NUMBER: @@ -88,7 +88,7 @@ def validate_value_in_limits(self): answer_ranges = self.questionnaire_schema.numeric_answer_ranges referred_answer = ( self.questionnaire_schema.get_numeric_value_for_value_source( - max_value, answer_ranges + value_source=max_value, answer_ranges=answer_ranges ) ) if referred_answer["max"] > MAX_NUMBER: diff --git a/app/validators/questionnaire_schema.py b/app/validators/questionnaire_schema.py index 1f7b282f..a7ea73c5 100644 --- a/app/validators/questionnaire_schema.py +++ b/app/validators/questionnaire_schema.py @@ -547,7 +547,7 @@ def is_block_in_repeating_section(self, block_id: str) -> bool: return parent_section and self.is_repeating_section(parent_section["id"]) def get_numeric_value_for_value_source( - self, value_source: Mapping[str, str], answer_ranges: Mapping[str, Mapping] + self, *, value_source: Mapping[str, str], answer_ranges: Mapping[str, Mapping] ) -> Mapping | None: referred_answer = None answers_to_calculate = self.get_answer_ids_for_value_source(value_source)