Skip to content

Commit

Permalink
FIX: control KeyError exception
Browse files Browse the repository at this point in the history
  • Loading branch information
nestorip committed Sep 21, 2020
1 parent e84effa commit 6727800
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions actions/api_cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,14 @@ def accept(self, dialog, complet_result, feature_id, _json, p_widget=None, clear
result = json.loads(row[0], object_pairs_hook=OrderedDict)

if "Accepted" in result['status']:
level = result['message']['level']
msg = result['message']['text']
self.controller.show_message(msg, message_level=level)
self.reload_fields(dialog, row, p_widget)
try:
level = result['message']['level']
msg = result['message']['text']
self.controller.show_message(msg, message_level=level)
except KeyError:
pass
finally:
self.reload_fields(dialog, row, p_widget)
elif "Failed" in result['status']:
msg = "FAIL"
self.controller.show_message(msg, message_level=2)
Expand Down

0 comments on commit 6727800

Please sign in to comment.