Commit 371adef0 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_web: Sort the tickets and include limit

On the UI we don't want to see infinity tickets, only the most relevant for the computers and hosting subscriptions.
parent 7ee689d0
......@@ -17,8 +17,12 @@ query = ComplexQuery(
logical_operator='or')
# Use event modification date instead.
kw['sort_on'] = [('modification_date', 'DESC'),]
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
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