django-formidable
django-formidable copied to clipboard
Should we allow duplicate conditions?
Before PR #301, a form with two identical conditions was considered invalid.
Since we've added the support for multiple conditions targeting a common field, such a form is now valid.
This behaviour is tested in test_end_point.py with the test called test_create_form_conditions_invalid_dup. We should decide if a form with two identical conditions should be considered valid or invalid.
This question should be addressed to the product, but I don't see any reason to set the form invalid. If you need to check the condition already exists well... the check is done. From this point, if the conditions are identical, can't you just ignore the second one?
Anyway, the final decision about this is also a frontend concern, because we can't let the user save and close the conditions modal if its content is invalid. Just like the case #301 we need to make sure that the backend behaviour matches with the current front.