correct handling of modification after creation

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3039 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2008-12-06 11:44:11 +00:00
parent d86dd04830
commit 67f9b7af98

View file

@ -132,18 +132,21 @@ class RecentChanges(TrackingStats):
result = []
for track in self.changeRecords:
if track.data['action'] == 'add' and track.taskId not in new:
sameChanged = changed.get(track.taskId)
if sameChanged and sameChanged.timeStamp < track.timeStamp + 60:
# change immediate after creation
if result[-1].taskId == track.taskId:
result.pop()
new[track.taskId] = track
result.append(track)
continue
if track.data['action'] == 'modify' and track.taskId not in changed:
sameNew = new.get(track.taskId)
if sameNew and sameNew.timeStamp > track.timeStamp - 60:
# change immediate after creation
continue
changed[track.taskId] = track
result.append(track)
continue
return dict(data=[TrackDetails(self, tr) for tr in result[:length]],
if len(resul) > length:
break
return dict(data=[TrackDetails(self, tr) for tr in result],
macro=self.macros['recent_changes'])