Commit afb892f7 authored by Nicolas Wavrant's avatar Nicolas Wavrant Committed by Eteri

SQLCatalog: allow "desc" as a sort keyword

Some listboxes in ERP5 use "| desc" to sort elements, even if it
didn't work (ie: Base_viewEventList/listbox).
Also, as "asc" is working (because descending sort is defined by
whitelist), adding "desc" makes things more consistent
parent 20f4a56b
......@@ -2348,7 +2348,7 @@ class Catalog(Folder,
if sort_order is not None and len(item) == 1:
item.append(sort_order)
if len(item) > 1:
if item[1] in ('descending', 'reverse', 'DESC'):
if item[1] in ('descending', 'reverse', 'desc', 'DESC'):
item[1] = 'DESC'
else:
item[1] = 'ASC'
......
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