Commit 9cc5a5b2 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Take it into account that alarm_date can be None.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30359 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a590b23f
...@@ -122,8 +122,12 @@ class AlarmTool(BaseTool): ...@@ -122,8 +122,12 @@ class AlarmTool(BaseTool):
alarm_date={'query':now,'range':'ngt'} alarm_date={'query':now,'range':'ngt'}
) )
# check again the alarm date in case the alarm was not yet reindexed # check again the alarm date in case the alarm was not yet reindexed
alarm_list = [x.getObject() for x in catalog_search \ alarm_list = []
if x.getObject().getAlarmDate()<=now] for x in catalog_search:
alarm = x.getObject()
alarm_date = alarm.getAlarmDate()
if alarm_date is not None and alarm_date <= now:
alarm_list.append(alarm)
else: else:
catalog_search = self.portal_catalog.unrestrictedSearchResults( catalog_search = self.portal_catalog.unrestrictedSearchResults(
portal_type = self.getPortalAlarmTypeList() portal_type = self.getPortalAlarmTypeList()
......
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