Commit 0675f6c9 authored by Ayush Tiwari's avatar Ayush Tiwari

[erp5_core] DiffTool: Raise error in case the selection for diff in a listbox...

[erp5_core] DiffTool: Raise error in case the selection for diff in a listbox has object not equal to 2
parent d4490220
......@@ -30,6 +30,9 @@ if first_path is None and second_path is None:
# create diff.
if list_selection_name is not None:
selected_obj_list = portal.portal_selections.getSelectionCheckedValueList(selection_name=list_selection_name)
# Check if the number of selected object is 2 only. otherwise raise an error
if len(selected_obj_list) != 2:
raise ValueError('Please select accurately 2 objects.')
object_revision_list.extend(selected_obj_list)
else:
# Return an empty list here. This would be the case when we first access
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment