You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding errors in a custom validator rule prevents direct trigger of this rule
Current Behaviour
Creating a validation rule like
def_validate_is_duration(self, is_duration, field, value):
""" Test if a field's value is a valid duration format The rule's arguments are validated against this schema: {'type': 'boolean'} """ifis_duration:
duration_pattern=r'^(\d+-\d+ weeks|\d+ weeks|\d+-\d+ months|\d+ months|\d+-\d+ years|\d+ years)$'ifnotre.match(duration_pattern, value):
self._error(field, f"Duration '{value}' is invalid")
Brief
Adding errors in a custom validator rule prevents direct trigger of this rule
Current Behaviour
Creating a validation rule like
and trying to trigger it using
Would give the error
Expected Behaviour
Either:
Workarounds
The following workarounds would work
Content Initialization
Initializing the
validator.document
to a dictionary would suppress the exception (with a wrong value set)Validating Whole Content
In more complete scenarios that may unnecessarily test other aspects''
The text was updated successfully, but these errors were encountered: