Remove addmore checkbox from update forms
This commit is contained in:
parent
e3ddf4cbaa
commit
3eb40cd5ed
2 changed files with 9 additions and 14 deletions
|
@ -23,15 +23,14 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
{% block buttons %}
|
{% block buttons %}
|
||||||
<tr>
|
{% if form.instance.adding %}
|
||||||
<td colspan="2">
|
<tr>
|
||||||
<label for="addmore">{% translate "Add another" %}</label>
|
<td colspan="2">
|
||||||
<input type="checkbox"
|
<label for="addmore">{% translate "Add another" %}</label>
|
||||||
name="addmore"
|
<input type="checkbox" name="addmore" id="addmore" checked />
|
||||||
id="addmore"
|
</td>
|
||||||
{% if form.instance.adding %}checked{% endif %} />
|
</tr>
|
||||||
</td>
|
{% endif %}
|
||||||
</tr>
|
|
||||||
<tr class="buttons">
|
<tr class="buttons">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
{% if not form.instance.adding %}
|
{% if not form.instance.adding %}
|
||||||
|
|
|
@ -80,11 +80,7 @@ class NummiCreateView(UserMixin, UserFormMixin, CreateView):
|
||||||
|
|
||||||
|
|
||||||
class NummiUpdateView(UserMixin, UserFormMixin, UpdateView):
|
class NummiUpdateView(UserMixin, UserFormMixin, UpdateView):
|
||||||
def form_valid(self, form):
|
pass
|
||||||
_res = super().form_valid(form)
|
|
||||||
if form.data["addmore"]:
|
|
||||||
return HttpResponseRedirect(self.object.get_create_url())
|
|
||||||
return _res
|
|
||||||
|
|
||||||
|
|
||||||
class NummiDeleteView(UserMixin, DeleteView):
|
class NummiDeleteView(UserMixin, DeleteView):
|
||||||
|
|
Loading…
Reference in a new issue