Bug fix while editing actions with missing keys
If a key is not present in the database, the panel failed to open the modal windows for edition, this fix that by using the dict.get() Change-Id: Ic5f5e216828f10d41f288408fc5109dc004c6ab9
This commit is contained in:
parent
3c55df31d2
commit
3cce1e3d3b
|
@ -68,9 +68,10 @@ class ActionWorkflowView(workflows.WorkflowView):
|
|||
self.kwargs['action_id'], json=True)
|
||||
initial.update(**action['freezer_action'])
|
||||
initial.update({
|
||||
"mandatory": action['mandatory'],
|
||||
"max_retries": action['max_retries'],
|
||||
"max_retries_interval": action['max_retries_interval']
|
||||
"mandatory": action.get('mandatory', None),
|
||||
"max_retries": action.get('max_retries', None),
|
||||
"max_retries_interval":
|
||||
action.get('max_retries_interval', None)
|
||||
})
|
||||
initial.update({'action_id': action['action_id']})
|
||||
return initial
|
||||
|
|
|
@ -388,6 +388,7 @@ class Action(object):
|
|||
utils.assign_and_remove(action, action_rules, 'max_retries_interval')
|
||||
utils.assign_and_remove(action, action_rules, 'mandatory')
|
||||
action = utils.create_dict(**action)
|
||||
action.pop('action_id', None)
|
||||
action = {'freezer_action': action}
|
||||
return self.client.actions.create(action)
|
||||
|
||||
|
|
Loading…
Reference in New Issue