Skip to content

Commit 1c5f8eb

Browse files
committed
Fix ValueConflictValidator
1 parent f9754a8 commit 1c5f8eb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

rdmo/projects/validators.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,15 @@ def __call__(self, data, serializer):
5858
'set_index': data.get('set_index')
5959
}
6060

61+
6162
# check the widget type, which is provided with the post request
6263
widget_type = serializer.context['view'].request.data.get('widget_type')
6364
if widget_type == 'checkbox':
6465
# for checkboxes, fail if a value with the same option exist
65-
get_kwargs['option'] = data.get('option')
66+
if data.get('option'):
67+
get_kwargs['option'] = data.get('option')
68+
if data.get('external_id'):
69+
get_kwargs['external_id'] = data.get('external_id')
6670
else:
6771
# for all other widget_types, fail if a value with the same collection_index exist
6872
get_kwargs['collection_index'] = data.get('collection_index')

0 commit comments

Comments
 (0)