Commit adafaeeb authored by Sebastien Robin's avatar Sebastien Robin

added check of the date in case an alarm was not reindexed yet


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3772 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 416ba18b
......@@ -119,10 +119,11 @@ TemplateTool manages Business Templates."""
now = str(DateTime())
date_expression = '<= %s' % now
catalog_search = self.portal_catalog(portal_type = self.getPortalAlarmTypeList(), alarm_date=date_expression)
# check again the alarm date in case the alarm was not yet reindexed
alarm_list = [x.getObject() for x in catalog_search if x.getObject().getAlarmDate()<=now]
else:
catalog_search = self.portal_catalog(portal_type = self.getPortalAlarmTypeList())
alarm_list = map(lambda x:x.getObject(),catalog_search)
LOG('AlarmTool.getAlarmList, alarm_list',0,alarm_list)
alarm_list = map(lambda x:x.getObject(),catalog_search)
return alarm_list
security.declareProtected(Permissions.ModifyPortalContent, 'tic')
......
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