@@ -681,16 +681,15 @@ def check_allowed_values(
681681 if value and value not in allowed_values :
682682 if value in previous_values :
683683 raise ValueError (
684- f'The value "{ value } " used in the "{ field } " field at index { index } of " { attribute } " '
685- f'must be defined in "{ values_defined_in [f"{ attribute } .{ field } " ]} ". Please remove '
686- f'"{ value } " from " { attribute } { index } .{ field } " before attempting to delete it.' ,
684+ f'The value "{ value } " used in the "{ field } " field of { attribute } [ { index } ] must be defined '
685+ f'in "{ values_defined_in [f"{ attribute } .{ field } " ]} ". Please remove " { value } " from '
686+ f'"{ attribute } [ { index } ] .{ field } " before attempting to delete it.' ,
687687 )
688688 else :
689689 raise ValueError (
690- f'The value "{ value } " used in the "{ field } " field at index { index } of "{ attribute } " '
691- f'must be defined in "{ values_defined_in [f"{ attribute } .{ field } " ]} ". Please add '
692- f'"{ value } " to "{ values_defined_in [f"{ attribute } .{ field } " ]} " before including it in '
693- f'"{ attribute } ".' ,
690+ f'The value "{ value } " used in the "{ field } " field of { attribute } [{ index } ] must be defined '
691+ f'in "{ values_defined_in [f"{ attribute } .{ field } " ]} ". Please add "{ value } " to '
692+ f'"{ values_defined_in [f"{ attribute } .{ field } " ]} " before including it in "{ attribute } ".' ,
694693 )
695694
696695 def check_allowed_source (self , attribute : str ) -> None :
@@ -728,16 +727,16 @@ def check_allowed_source(self, attribute: str) -> None:
728727 if (value := model .source ) != "" and value not in allowed_values :
729728 if value in previous_values :
730729 raise ValueError (
731- f'The value "{ value } " used in the "source" field at index { index } of " { attribute } " '
732- f'must be defined in "{ values_defined_in [f"{ attribute } .{ model .type } .source" ]} ". Please remove '
733- f'"{ value } " from " { attribute } { index } .source" before attempting to delete it.' ,
730+ f'The value "{ value } " used in the "source" field of { attribute } [ { index } ] must be defined in '
731+ f'"{ values_defined_in [f"{ attribute } .{ model .type } .source" ]} ". Please remove " { value } " from '
732+ f'"{ attribute } [ { index } ] .source" before attempting to delete it.' ,
734733 )
735734 else :
736735 raise ValueError (
737- f'The value "{ value } " used in the "source" field at index { index } of " { attribute } " '
738- f'must be defined in "{ values_defined_in [f"{ attribute } .{ model .type } .source" ]} ". Please add '
739- f'"{ value } " to " { values_defined_in [f"{ attribute } .{ model .type } .source" ]} " before including it '
740- f'in "{ attribute } ".' ,
736+ f'The value "{ value } " used in the "source" field of { attribute } [ { index } ] must be defined in '
737+ f'"{ values_defined_in [f"{ attribute } .{ model .type } .source" ]} ". Please add " { value } " to '
738+ f'"{ values_defined_in [f"{ attribute } .{ model .type } .source" ]} " before including it in '
739+ f'"{ attribute } ".' ,
741740 )
742741
743742 def check_contrast_model_allowed_values (
@@ -771,16 +770,15 @@ def check_contrast_model_allowed_values(
771770 if (model_values := contrast .model ) and not all (value in allowed_values for value in model_values ):
772771 if all (value in previous_values for value in model_values ):
773772 raise ValueError (
774- f'The values: "{ ", " .join (str (i ) for i in model_values )} " used in the "model" field at index '
775- f'{ index } of " { contrast_attribute } " must be defined in "{ allowed_field } ". Please remove '
773+ f'The values: "{ ", " .join (str (i ) for i in model_values )} " used in the "model" field of '
774+ f'{ contrast_attribute } [ { index } ] must be defined in "{ allowed_field } ". Please remove '
776775 f'all unnecessary values from "model" before attempting to delete them.' ,
777776 )
778777 else :
779778 raise ValueError (
780- f'The values: "{ ", " .join (str (i ) for i in model_values )} " used in the "model" field at index '
781- f'{ index } of "{ contrast_attribute } " must be defined in "{ allowed_field } ". Please add '
782- f'all required values to "{ allowed_field } " '
783- f'before including them in "{ contrast_attribute } ".' ,
779+ f'The values: "{ ", " .join (str (i ) for i in model_values )} " used in the "model" field of '
780+ f'{ contrast_attribute } [{ index } ] must be defined in "{ allowed_field } ". Please add '
781+ f'all required values to "{ allowed_field } " before including them in "{ contrast_attribute } ".' ,
784782 )
785783
786784 def get_contrast_model_field (self ):
0 commit comments