Remove addmore checkbox from update forms

This commit is contained in:
Edgar P. Burkhart 2023-04-20 11:07:17 +02:00
parent e3ddf4cbaa
commit 3eb40cd5ed
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 9 additions and 14 deletions

View file

@ -23,15 +23,14 @@
</tbody>
<tfoot>
{% block buttons %}
{% if form.instance.adding %}
<tr>
<td colspan="2">
<label for="addmore">{% translate "Add another" %}</label>
<input type="checkbox"
name="addmore"
id="addmore"
{% if form.instance.adding %}checked{% endif %} />
<input type="checkbox" name="addmore" id="addmore" checked />
</td>
</tr>
{% endif %}
<tr class="buttons">
<td colspan="2">
{% if not form.instance.adding %}

View file

@ -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):