Fix the status view when it cannot be loaded

This commit is contained in:
Joseph Schorr 2014-03-25 15:48:12 -04:00
parent 99cdc0402a
commit 4a66bd4af2

View file

@ -1160,15 +1160,12 @@ def get_job_config(build_obj):
def build_status_view(build_obj, can_write=False):
status = build_logs.get_status(build_obj.uuid)
if not status:
status = 'cannot_load'
return {
'id': build_obj.uuid,
'phase': build_obj.phase,
'phase': build_obj.phase if status else 'cannot_load',
'started': build_obj.started,
'display_name': build_obj.display_name,
'status': status,
'status': status or {},
'job_config': get_job_config(build_obj) if can_write else None,
'is_writer': can_write,
'trigger': trigger_view(build_obj.trigger),