Skip to content

Commit

Permalink
Restore self.object
Browse files Browse the repository at this point in the history
Though this was removed in fd1eda4
it seems to cause issues with prefetch_related_objects() in certain
cases, though it shows up inconsistently in different environments.
  • Loading branch information
kfdm committed Apr 16, 2024
1 parent 600732c commit a3ef8d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions promgen/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit a3ef8d5

Please sign in to comment.