Commit 98cd0d30 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Convert each uid to a string for generating a checksum, to avoid different...

Convert each uid to a string for generating a checksum, to avoid different representations of long and int.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3068 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 904fa415
...@@ -1059,13 +1059,11 @@ class ListBoxWidget(Widget.Widget): ...@@ -1059,13 +1059,11 @@ class ListBoxWidget(Widget.Widget):
# #
############################################################### ###############################################################
object_uid_list = map(lambda x: getattr(x, 'uid', None), object_list) # XXX To avoid the difference of the string representations of int and long,
#LOG('ListBox.render, object_uid_list:',0,object_uid_list) # convert each element to a string.
sorted_object_uid_list = copy(object_uid_list) object_uid_list = [str(getattr(x, 'uid', None)) for x in object_list]
sorted_object_uid_list.sort() object_uid_list.sort()
md5_string = md5.new(str(sorted_object_uid_list)).hexdigest() md5_string = md5.new(str(object_uid_list)).hexdigest()
#md5_string = md5.new(str(object_uid_list)).digest()
############################################################### ###############################################################
# #
......
...@@ -756,17 +756,12 @@ class SelectionTool( UniqueObject, SimpleItem ): ...@@ -756,17 +756,12 @@ class SelectionTool( UniqueObject, SimpleItem ):
""" """
We want to be sure that the selection did not change We want to be sure that the selection did not change
""" """
#LOG('selectionHasChanged, md5_string',0,md5_string) # XXX To avoid the difference of the string representations of int and long,
#LOG('selectionHasChanged, object_uid_list',0,object_uid_list) # convert each element to a string.
sorted_object_uid_list = copy(object_uid_list) object_uid_list = [str(x) for x in object_uid_list]
sorted_object_uid_list.sort() object_uid_list.sort()
new_md5_string = md5.new(str(sorted_object_uid_list)).hexdigest() new_md5_string = md5.new(str(object_uid_list)).hexdigest()
#LOG('selectionHasChanged, new_md5_string',0,new_md5_string) return md5_string != new_md5_string
if md5_string != new_md5_string:
#LOG('selectionHasChanged, return...',0,'True')
return True
#LOG('selectionHasChanged, return...',0,'False')
return False
security.declareProtected(ERP5Permissions.View, 'getPickle') security.declareProtected(ERP5Permissions.View, 'getPickle')
def getPickle(self,**kw): def getPickle(self,**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