From 3eb40cd5ed318ccdab10f173ba1fab2fb2d82f89 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Thu, 20 Apr 2023 11:07:17 +0200 Subject: [PATCH] Remove addmore checkbox from update forms --- nummi/main/templates/main/form/base.html | 17 ++++++++--------- nummi/main/views.py | 6 +----- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/nummi/main/templates/main/form/base.html b/nummi/main/templates/main/form/base.html index d4c9652..e0b5b7d 100644 --- a/nummi/main/templates/main/form/base.html +++ b/nummi/main/templates/main/form/base.html @@ -23,15 +23,14 @@ {% block buttons %} - - - - - - + {% if form.instance.adding %} + + + + + + + {% endif %} {% if not form.instance.adding %} diff --git a/nummi/main/views.py b/nummi/main/views.py index 3fc87d9..3c465fc 100644 --- a/nummi/main/views.py +++ b/nummi/main/views.py @@ -80,11 +80,7 @@ class NummiCreateView(UserMixin, UserFormMixin, CreateView): class NummiUpdateView(UserMixin, UserFormMixin, UpdateView): - def form_valid(self, form): - _res = super().form_valid(form) - if form.data["addmore"]: - return HttpResponseRedirect(self.object.get_create_url()) - return _res + pass class NummiDeleteView(UserMixin, DeleteView):