Skip to content

Commit 226dfd9

Browse files
committed
Guard against missing response data
1 parent 2abe6d2 commit 226dfd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

biocloudcentral/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def launch_status(request):
108108
if response.get("error", ""):
109109
# If a key got created, allow the user to download it even if
110110
# an error was encountered.
111-
if response['kp_material']:
111+
if response.get('kp_material'):
112112
request.session['ec2data']['kp_name'] = response['kp_name']
113113
request.session['ec2data']['kp_material'] = response['kp_material']
114114
r['kp_name'] = response['kp_name']
@@ -129,7 +129,7 @@ def launch_status(request):
129129
r['instance_id'] = response['instance_id']
130130
r['sg_name'] = response['sg_names'][0]
131131
r['kp_name'] = response['kp_name']
132-
r['kp_material'] = response['kp_material']
132+
r['kp_material'] = response.get('kp_material', '')
133133
r['image_id'] = response['image_id']
134134

135135
# Add an entry to the Usage table now

0 commit comments

Comments
 (0)