Commit badb4d93 authored by Nicolas Delaby's avatar Nicolas Delaby

Set acquisition context when creating Signature, change equality test for None values

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16748 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 13797709
...@@ -856,7 +856,7 @@ class XMLSyncUtilsMixin(SyncCode): ...@@ -856,7 +856,7 @@ class XMLSyncUtilsMixin(SyncCode):
if isinstance(xml_string, unicode): if isinstance(xml_string, unicode):
xml_string = xml_object.encode('utf-8') xml_string = xml_object.encode('utf-8')
gid = subscriber.getGidFromObject(object) gid = subscriber.getGidFromObject(object)
signature = Signature(id=gid, object=object) signature = Signature(id=gid, object=object).__of__(subscriber)
signature.setTempXML(xml_object) signature.setTempXML(xml_object)
if xml_string.count('\n') > self.MAX_LINES: if xml_string.count('\n') > self.MAX_LINES:
if xml_string.find('--') >= 0: # This make comment fails, so we need to replace if xml_string.find('--') >= 0: # This make comment fails, so we need to replace
...@@ -875,7 +875,7 @@ class XMLSyncUtilsMixin(SyncCode): ...@@ -875,7 +875,7 @@ class XMLSyncUtilsMixin(SyncCode):
signature.setAction('Add') signature.setAction('Add')
xml_string = '<!--' + short_string + '-->' xml_string = '<!--' + short_string + '-->'
gid = signature.getRid()#in fisrt, we try with rid if there is one gid = signature.getRid()#in fisrt, we try with rid if there is one
if gid == None: if gid is None:
gid = signature.getGid() gid = signature.getGid()
syncml_data += self.addXMLObject( syncml_data += self.addXMLObject(
cmd_id=cmd_id, cmd_id=cmd_id,
......
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