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>
|
||||
<tfoot>
|
||||
{% block buttons %}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<label for="addmore">{% translate "Add another" %}</label>
|
||||
<input type="checkbox"
|
||||
name="addmore"
|
||||
id="addmore"
|
||||
{% if form.instance.adding %}checked{% endif %} />
|
||||
</td>
|
||||
</tr>
|
||||
{% if form.instance.adding %}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<label for="addmore">{% translate "Add another" %}</label>
|
||||
<input type="checkbox" name="addmore" id="addmore" checked />
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr class="buttons">
|
||||
<td colspan="2">
|
||||
{% if not form.instance.adding %}
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue