Do not compute badge for skipped and display warning badge

This commit is contained in:
Martin Trigaux 2014-06-17 14:22:46 +02:00
parent ad834107c3
commit 50565224b5

View File

@ -918,6 +918,7 @@ class RunbotController(http.Controller):
('branch_id.branch_name', '=', branch),
('branch_id.sticky', '=', True),
('state', 'in', ['testing', 'running', 'done']),
('result', '!=', 'skipped'),
]
last_update = '__last_update'
@ -940,8 +941,13 @@ class RunbotController(http.Controller):
state = 'testing'
cache_factor = 1
else:
state = 'success' if build['result'] == 'ok' else 'failed'
cache_factor = 2
if build['result'] == 'ok':
state = 'success'
elif build['result'] == 'warn':
state = 'warning'
else:
state = 'failed'
# from https://github.com/badges/shields/blob/master/colorscheme.json
color = {