Merge pull request #422 from sartography/chore/group-repeating-validation-536

Fixes #536 - Group + Repeating property validation
This commit is contained in:
Dan Funk 2021-11-10 15:28:04 -05:00 committed by GitHub
commit 037692f42b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -258,6 +258,11 @@ class WorkflowService(object):
if field.has_property("read_only") and field.get_property(Task.FIELD_PROP_READ_ONLY).lower().strip() == "true":
continue # Don't mess about with read only fields.
if field.has_property(Task.FIELD_PROP_REPEAT) and field.has_property(Task.FIELD_PROP_GROUP):
raise ApiError.from_task("group_repeat", f'Fields cannot have both group and repeat properties. '
f' Please remove one of these properties. ',
task=task)
if field.has_property(Task.FIELD_PROP_REPEAT):
group = field.get_property(Task.FIELD_PROP_REPEAT)
if group in form_data and not(isinstance(form_data[group], list)):