Fix exception error when creating audit without audit template
When there is no audit template, data['audit_template'] raises KeyError. Use data.get('audit_template') instead of data['audit_template']. Change-Id: Ic6bcaa8834cbfb6191ce1674a53895140605bf07 Closes-Bug: #1681818
This commit is contained in:
parent
9a33f7eb15
commit
ed7190c58d
@ -82,7 +82,7 @@ class CreateForm(forms.SelfHandlingForm):
|
||||
|
||||
def handle(self, request, data):
|
||||
try:
|
||||
params = {'audit_template_uuid': data['audit_template']}
|
||||
params = {'audit_template_uuid': data.get('audit_template')}
|
||||
params['audit_type'] = data['audit_type'].upper()
|
||||
params['auto_trigger'] = data['auto_trigger']
|
||||
if data['audit_type'] == 'continuous':
|
||||
|
Loading…
x
Reference in New Issue
Block a user