def dispatch(self, request, *args, **kwargs):
    response_data = {}
    message = Message.objects.get(id=request.POST.get('messageId'))
    message.visualized = True
    message.save()
    response_data['result'] = 'Message visualized!'
    response_data['visualized'] = message.visualized
    return HttpResponse(json.dumps(response_data), content_type='application/json')
def dispatch(self, request, *args, **kwargs):
    response_data = {}
    message = Message.objects.get(id=request.POST.get('messageId'))
    message.visualized = True
    message.save()
    response_data['result'] = 'Message visualized!'
    response_data['visualized'] = message.visualized
    return HttpResponse(json.dumps(response_data), content_type='application/json')