def METHOD_NAME(form, field):
    # Note: state_code is only a required field if the chosen country is India
    if form.country_code.data == "IN":
        if field.data.upper() not in indian_states_dict:
            raise forms.validators.StopValidation(__("Please select a state"))