From a3ef8d56fd68101751ecb0ae597181c5f15ab981 Mon Sep 17 00:00:00 2001 From: Paul Traylor Date: Tue, 16 Apr 2024 16:33:16 +0900 Subject: [PATCH] Restore self.object Though this was removed in fd1eda4c479e9a070e886d95bcf9e3a9b37f59c5 it seems to cause issues with prefetch_related_objects() in certain cases, though it shows up inconsistently in different environments. --- promgen/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/promgen/views.py b/promgen/views.py index 49651139f..1a75372a0 100644 --- a/promgen/views.py +++ b/promgen/views.py @@ -780,6 +780,8 @@ def form_invalid(self, **kwargs): return self.render_to_response(self.get_context_data(**kwargs)) def post(self, request, *args, **kwargs): + self.object = self.get_object() + # Save a copy of our forms into a context var that we can use # to re-render our form properly in case of errors context = {}