Commit e3f547f2 authored by Łukasz Nowak's avatar Łukasz Nowak

Fixup date passing.

parent fa695e83
...@@ -56,12 +56,12 @@ kw = {}\n ...@@ -56,12 +56,12 @@ kw = {}\n
search_kw = {}\n search_kw = {}\n
from DateTime import DateTime\n from DateTime import DateTime\n
from Products.ZSQLCatalog.SQLCatalog import Query\n from Products.ZSQLCatalog.SQLCatalog import Query\n
from Products.ERP5Type.DateUtils import getClosestDate, addToDate\n from Products.ERP5Type.DateUtils import addToDate\n
\n \n
last_active_process = context.getLastActiveProcess()\n last_active_process = context.getLastActiveProcess()\n
if last_active_process is not None and not(params.get(\'full\', False)):\n if last_active_process is not None and not(params.get(\'full\', False)):\n
# fetch only objects modified since last alarm run\n # fetch only objects modified since last alarm run\n
kw[\'modification_date\'] = Query(modification_date=last_active_process.getStartDate(), range="min")\n kw[\'modification_date\'] = last_active_process.getStartDate()\n
search_kw[\'modification_date\'] = Query(modification_date=addToDate(last_active_process.getStartDate(), to_add={\'hour\': -1}), range="min")\n search_kw[\'modification_date\'] = Query(modification_date=addToDate(last_active_process.getStartDate(), to_add={\'hour\': -1}), range="min")\n
# register active process in order to have "windows" of last indexed objects\n # register active process in order to have "windows" of last indexed objects\n
context.newActiveProcess()\n context.newActiveProcess()\n
......
...@@ -51,12 +51,12 @@ ...@@ -51,12 +51,12 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.ZSQLCatalog.SQLCatalog import Query\n <value> <string>from Products.ZSQLCatalog.SQLCatalog import Query\n
from Products.ERP5Type.DateUtils import addToDate\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
kw = {}\n kw = {}\n
if modification_date is not None:\n if modification_date is not None:\n
kw[\'modification_date\'] = Query(modification_date=modification_date, range="min")\n kw[\'modification_date\'] = Query(modification_date=addToDate(modification_date, to_add={\'hour\': -1}), range="min")\n
\n
remove_hosting_list = []\n remove_hosting_list = []\n
add_kw_list = []\n add_kw_list = []\n
start_date_tuple_list = []\n start_date_tuple_list = []\n
......
756 757
\ No newline at end of file \ No newline at end of file
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