Skip to content

Commit

Permalink
Smartmin doesn't concern itself with formax
Browse files Browse the repository at this point in the history
  • Loading branch information
ericnewcomer committed Nov 25, 2024
1 parent 4f69300 commit 34d8010
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions smartmin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,12 +1094,9 @@ def form_valid(self, form):
self.object = self.post_save(self.object)

messages.success(self.request, self.derive_success_message())
if "HTTP_X_FORMAX" not in self.request.META:
return HttpResponseRedirect(self.get_success_url())
else:
response = self.render_to_response(self.get_context_data(form=form))
response["REDIRECT"] = self.get_success_url()
return response
response = self.render_to_response(self.get_context_data(form=form))
response["REDIRECT"] = self.get_success_url()
return response

except IntegrityError as e:
message = str(e).capitalize()
Expand Down

0 comments on commit 34d8010

Please sign in to comment.