questions icon indicating copy to clipboard operation
questions copied to clipboard

Bug in ExpressionValidator class

Open carlosandujar opened this issue 7 months ago • 0 comments

  • Questions version: 0.8.0 and current
  • Python version: 3.9
  • Operating System: Windows 10

Description

The following validator does not work as expected:

RadioGroupQuestion(title="Do you agree?", choices=["Yes", "No"], required=True, validators = [ ExpressionValidator(expression="{consent} == 'Yes'") ])

A workaround is to explicitly set kind="expression", in the ExpressionValidator constructor.

This is due to an error in class ExpressionValidator(Validator) that contains kind: str = "regex" which should be kind: str = "expression"

carlosandujar avatar Jul 03 '24 06:07 carlosandujar