Skip to content

Support custom validation messages

No due date 0% complete

This could be a class level attribute or a site wide config where we support

Either

    CONDITIONAL_REQUIRED_TOGGLE_FIELDS = [
        (
            lambda instance: instance.user.is_active, ['fixed_price', 'percentage', 'amount'], msg
        ),
    ]

OR a class level

    CONDITIONAL_REQUIRED_MSG =  _("Please provide only one of the following '%(field_na…

This could be a class level attribute or a site wide config where we support

Either

    CONDITIONAL_REQUIRED_TOGGLE_FIELDS = [
        (
            lambda instance: instance.user.is_active, ['fixed_price', 'percentage', 'amount'], msg
        ),
    ]

OR a class level

    CONDITIONAL_REQUIRED_MSG =  _("Please provide only one of the following '%(field_names)s'.")