Commit c1cb1cc3 authored by Jérome Perrin's avatar Jérome Perrin

administration: fix catalog table scan in Item_checkTrackingList

This fix a regression from 920655a2 : when item has no tracking, uid was
passed an empty list and this fetched all catalog.
Also call getObject explicitly only once instead of having it called
implicitly twice.
parent 75fe7b4b
......@@ -2,13 +2,14 @@ from Products.CMFActivity.ActiveResult import ActiveResult
portal = context.getPortalObject()
tracking_list = list(reversed(portal.portal_simulation.getCurrentTrackingList(aggregate_uid=context.getUid())))
delivery_dict = {
x.uid: x
if tracking_list:
delivery_dict = {
x.uid: x.getObject()
for x in portal.portal_catalog(
uid=[x.delivery_uid for x in tracking_list],
)
}
for previous_brain, next_brain in zip(tracking_list, tracking_list[1:]):
}
for previous_brain, next_brain in zip(tracking_list, tracking_list[1:]):
if delivery_dict[previous_brain.delivery_uid].getDestination() != delivery_dict[next_brain.delivery_uid].getSource():
portal.restrictedTraverse(active_process).postResult(
ActiveResult(summary=script.getId(),
......
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