Commit dad69045 authored by Sebastien Robin's avatar Sebastien Robin

make sure copies are deleted


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@848 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bfe7565b
...@@ -615,7 +615,8 @@ class Subscription(SyncCode, Implicit): ...@@ -615,7 +615,8 @@ class Subscription(SyncCode, Implicit):
""" """
return the xml mapping return the xml mapping
""" """
return self.xml_mapping xml_mapping = getattr(self,'xml_mapping','asXML')
return xml_mapping
def setXMLMapping(self, xml_mapping): def setXMLMapping(self, xml_mapping):
""" """
......
...@@ -414,6 +414,11 @@ class SynchronizationTool( UniqueObject, SimpleItem, ...@@ -414,6 +414,11 @@ class SynchronizationTool( UniqueObject, SimpleItem,
signature.delConflict(conflict) signature.delConflict(conflict)
if signature.getConflictList() == []: if signature.getConflictList() == []:
LOG('p_sync.applyPublisherValue, conflict_list empty on : ',0,signature) LOG('p_sync.applyPublisherValue, conflict_list empty on : ',0,signature)
# Delete the copy of the object if the there is one
directory = object.aq_parent
copy_id = object.id + '_conflict_copy'
if copy_id in directory.objectIds():
directory._delObject(copy_id)
signature.setStatus(self.PUB_CONFLICT_MERGE) signature.setStatus(self.PUB_CONFLICT_MERGE)
security.declareProtected(Permissions.ModifyPortalContent, 'applyPublisherDocument') security.declareProtected(Permissions.ModifyPortalContent, 'applyPublisherDocument')
...@@ -428,7 +433,7 @@ class SynchronizationTool( UniqueObject, SimpleItem, ...@@ -428,7 +433,7 @@ class SynchronizationTool( UniqueObject, SimpleItem,
LOG('applyPublisherDocument, applying on conflict: ',0,conflict) LOG('applyPublisherDocument, applying on conflict: ',0,conflict)
c.applyPublisherValue() c.applyPublisherValue()
security.declareProtected(Permissions.ModifyPortalContent, 'getPublisherDocumentPath') security.declareProtected(Permissions.AccessContentsInformation, 'getPublisherDocumentPath')
def getPublisherDocumentPath(self, conflict): def getPublisherDocumentPath(self, conflict):
""" """
apply the publisher value for all conflict of the given document apply the publisher value for all conflict of the given document
...@@ -436,7 +441,7 @@ class SynchronizationTool( UniqueObject, SimpleItem, ...@@ -436,7 +441,7 @@ class SynchronizationTool( UniqueObject, SimpleItem,
subscriber = conflict.getSubscriber() subscriber = conflict.getSubscriber()
return conflict.getObjectPath() return conflict.getObjectPath()
security.declareProtected(Permissions.ModifyPortalContent, 'getPublisherDocument') security.declareProtected(Permissions.AccessContentsInformation, 'getPublisherDocument')
def getPublisherDocument(self, conflict): def getPublisherDocument(self, conflict):
""" """
apply the publisher value for all conflict of the given document apply the publisher value for all conflict of the given document
...@@ -447,7 +452,7 @@ class SynchronizationTool( UniqueObject, SimpleItem, ...@@ -447,7 +452,7 @@ class SynchronizationTool( UniqueObject, SimpleItem,
LOG('getPublisherDocument publisher_object',0,publisher_object) LOG('getPublisherDocument publisher_object',0,publisher_object)
return publisher_object return publisher_object
security.declareProtected(Permissions.ModifyPortalContent, 'getSubscriberDocumentPath') security.declareProtected(Permissions.AccessContentsInformation, 'getSubscriberDocumentPath')
def getSubscriberDocumentPath(self, conflict): def getSubscriberDocumentPath(self, conflict):
""" """
apply the publisher value for all conflict of the given document apply the publisher value for all conflict of the given document
...@@ -468,7 +473,7 @@ class SynchronizationTool( UniqueObject, SimpleItem, ...@@ -468,7 +473,7 @@ class SynchronizationTool( UniqueObject, SimpleItem,
c.applySubscriberValue(object=subscriber_document) c.applySubscriberValue(object=subscriber_document)
return subscriber_document.getPhysicalPath() return subscriber_document.getPhysicalPath()
security.declareProtected(Permissions.ModifyPortalContent, 'getSubscriberDocument') security.declareProtected(Permissions.AccessContentsInformation, 'getSubscriberDocument')
def getSubscriberDocument(self, conflict): def getSubscriberDocument(self, conflict):
""" """
apply the publisher value for all conflict of the given document apply the publisher value for all conflict of the given document
...@@ -510,6 +515,11 @@ class SynchronizationTool( UniqueObject, SimpleItem, ...@@ -510,6 +515,11 @@ class SynchronizationTool( UniqueObject, SimpleItem,
if solve_conflict: if solve_conflict:
signature.delConflict(conflict) signature.delConflict(conflict)
if signature.getConflictList() == []: if signature.getConflictList() == []:
# Delete the copy of the object if the there is one
directory = object.aq_parent
copy_id = object.id + '_conflict_copy'
if copy_id in directory.objectIds():
directory._delObject(copy_id)
signature.setStatus(self.PUB_CONFLICT_MERGE) signature.setStatus(self.PUB_CONFLICT_MERGE)
......
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