If form valid return response with action

def form_valid(self, form):
        """ If form valid return response with action """
        response = super(FormAjaxMixin, self).form_valid(form)
        if self.request.is_ajax():
            return self.json_to_response()
        return response