Commit fb95b945 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Remove unsupported sort, and make the script more reusable

parent fd0b8d89
......@@ -16,13 +16,11 @@ query = ComplexQuery(
logical_operator='and'),
logical_operator='or')
# Use event modification date instead.
kw['sort_on'] = (("catalog.simulation_state='suspended'", 'DESC'),
("catalog.simulation_state='validated'", 'DESC'),
("catalog.simulation_state='confirmed'", 'DESC'),
('modification_date', 'DESC'),)
kw['simulation_state'] = "NOT cancelled"
kw['limit'] = 30
kw['sort_on'] = (('modification_date', 'DESC'),)
if 'simulation_state' not in kw:
kw['simulation_state'] = "NOT cancelled"
if 'limit' not in kw:
kw['limit'] = 30
result_list = []
for document in portal.portal_catalog(query=query, **kw):
if document.getPortalType() == "Upgrade Decision Line":
......
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