Commit 87e74846 authored by Sebastien Robin's avatar Sebastien Robin

check in a better way if the selection has changed


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@766 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d7425eeb
##parameters=form_id,cancel_url,dialog_method,selection_name,dialog_id,md5_object_uid_list=None
##parameters=form_id,cancel_url,dialog_method,selection_name,dialog_id,previous_md5_object_uid_list=None
# Updates attributes of an Zope document
# which is in a class inheriting from ERP5 Base
......@@ -35,10 +35,11 @@ try:
kw['dialog_id'] = dialog_id
kw['selection_name'] = selection_name
# Check if the selection did not changed
if md5_object_uid_list is not None:
if previous_md5_object_uid_list is not None:
selection_list = context.portal_selections.callSelectionFor(selection_name, context=context)
if selection_list is not None:
object_uid_list = map(lambda x:x.getObject().getUid(),selection_list)
error = context.portal_selections.selectionHasChanged(md5_object_uid_list,object_uid_list)
error = context.portal_selections.selectionHasChanged(previous_md5_object_uid_list,object_uid_list)
if error:
error_message = 'Sorry+your+selection+has+changed'
url_params_string = make_query(**kw)
......
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