workflow traces: do not crash on empty event_args (#73733)
gitea-wip/wcs/pipeline/pr-main This commit looks good
Details
gitea-wip/wcs/pipeline/pr-main This commit looks good
Details
This commit is contained in:
parent
92dac5eb8c
commit
4a184b56de
|
@ -97,6 +97,8 @@ class WorkflowTrace(sql.WorkflowTrace):
|
|||
|
||||
def get_base_url(self, workflow, status_id, global_event):
|
||||
if global_event:
|
||||
if not global_event.event_args:
|
||||
raise KeyError()
|
||||
return '%sglobal-actions/%s/' % (
|
||||
workflow.get_admin_url(),
|
||||
global_event.event_args.get('global_action_id'),
|
||||
|
@ -106,6 +108,8 @@ class WorkflowTrace(sql.WorkflowTrace):
|
|||
|
||||
def get_real_action(self, workflow, status_id, action_id, global_event):
|
||||
if global_event:
|
||||
if not global_event.event_args:
|
||||
return None
|
||||
global_action_id = global_event.event_args.get('global_action_id')
|
||||
try:
|
||||
global_action = [x for x in workflow.global_actions if x.id == global_action_id][0]
|
||||
|
|
Loading…
Reference in New Issue