From 0a0400c1ac90b1ef6c1793d0f979f2295b1a3a42 Mon Sep 17 00:00:00 2001 From: Mark Vergunst Date: Tue, 17 Sep 2024 13:22:54 +0200 Subject: [PATCH] #236: added self.object to form.save() --- bootstrap_modal_forms/mixins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap_modal_forms/mixins.py b/bootstrap_modal_forms/mixins.py index eeaff5d..c419f84 100644 --- a/bootstrap_modal_forms/mixins.py +++ b/bootstrap_modal_forms/mixins.py @@ -93,10 +93,10 @@ def form_valid(self, form): if isAjaxRequest: if asyncUpdate: - form.save() + self.object = form.save() return HttpResponse(status=204) - form.save() + self.object = form.save() messages.success(self.request, self.get_success_message()) return HttpResponseRedirect(self.get_success_url())