mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-23 21:28:32 +00:00
Fixes #536 - Group + Repeating property validation
For now, we should not allow both group and repeat properties on a field together.
This commit is contained in:
parent
9376d3deaf
commit
accdd281fa
@ -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":
|
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.
|
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):
|
if field.has_property(Task.FIELD_PROP_REPEAT):
|
||||||
group = field.get_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)):
|
if group in form_data and not(isinstance(form_data[group], list)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user