1
As mentioned in comments your question is duplicate of django MultiValueDictKeyError error, how do i deal with it
But there are some improvements that can be done to your code
Change your code to
if request.GET.get('customActionType', '') == 'group_action':
records['customActionStatus'] = 'OK'
records['customActionMessage'] = 'Group action successfully has been completed. Well done!'
This way you won’t have to do 2 checks
Source:stackexchange.com