mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot: sort sticky branches chronologically
On a par with `/glances` page.
This commit is contained in:
parent
76ea2a4f5d
commit
f3ae3cac5a
@ -90,7 +90,7 @@ class Runbot(Controller):
|
|||||||
ORDER BY bu.sequence DESC
|
ORDER BY bu.sequence DESC
|
||||||
"""
|
"""
|
||||||
sticky_dom = [('repo_id', '=', repo.id), ('sticky', '=', True)]
|
sticky_dom = [('repo_id', '=', repo.id), ('sticky', '=', True)]
|
||||||
sticky_branch_ids = [] if search else branch_obj.search(sticky_dom).ids
|
sticky_branch_ids = [] if search else branch_obj.search(sticky_dom).sorted(key=lambda b: (b.branch_name == 'master', b.id), reverse=True).ids
|
||||||
request._cr.execute(branch_query, (tuple(build_ids.ids),))
|
request._cr.execute(branch_query, (tuple(build_ids.ids),))
|
||||||
branch_ids = uniq_list(sticky_branch_ids + [br[0] for br in request._cr.fetchall()])
|
branch_ids = uniq_list(sticky_branch_ids + [br[0] for br in request._cr.fetchall()])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user