Fix management of deletedContribution during sync process
This commit is contained in:
parent
02521de7b4
commit
04db6c03db
1 changed files with 4 additions and 0 deletions
|
@ -123,6 +123,8 @@ class Group(object):
|
|||
for uuid in group.deletedContributions:
|
||||
if uuid not in ret.deletedContributions:
|
||||
ret.deletedContributions[uuid]=group.deletedContributions[uuid]
|
||||
elif ret.deletedContributions[uuid].lastChange<group.deletedContributions[uuid].lastChange:
|
||||
ret.deletedContributions[uuid]=group.deletedContributions[uuid]
|
||||
|
||||
## Contributions
|
||||
for uuid in self.contributions:
|
||||
|
@ -132,12 +134,14 @@ class Group(object):
|
|||
ret.contributions[uuid]=self.contributions[uuid]
|
||||
elif self.contributions[uuid].lastChange>ret.deletedContributions[uuid].lastChange:
|
||||
ret.contributions[uuid]=self.contributions[uuid]
|
||||
del ret.deletedContributions[uuid]
|
||||
for uuid in group.contributions:
|
||||
if uuid not in ret.contributions:
|
||||
if uuid not in ret.deletedContributions:
|
||||
ret.contributions[uuid]=group.contributions[uuid]
|
||||
elif group.contributions[uuid].lastChange>ret.deletedContributions[uuid].lastChange:
|
||||
ret.contributions[uuid]=group.contributions[uuid]
|
||||
del ret.deletedContributions[uuid]
|
||||
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Reference in a new issue