Browse Source

Fix #1925 (#1926)

pull/1927/head
Victor Fabre 7 years ago
committed by Edward
parent
commit
40da78b14a
  1. 5
      sapl/sessao/views.py
  2. 1
      sapl/templates/sessao/expediente.html

5
sapl/sessao/views.py

@ -1448,6 +1448,11 @@ class ExpedienteView(FormMixin, DetailView):
self.object = self.get_object() self.object = self.get_object()
form = ExpedienteForm(request.POST) form = ExpedienteForm(request.POST)
if 'apagar-expediente' in request.POST:
ExpedienteSessao.objects.filter(
sessao_plenaria_id=self.object.id).delete()
return self.form_valid(form)
if form.is_valid(): if form.is_valid():
list_tipo = request.POST.getlist('tipo') list_tipo = request.POST.getlist('tipo')
list_conteudo = request.POST.getlist('conteudo') list_conteudo = request.POST.getlist('conteudo')

1
sapl/templates/sessao/expediente.html

@ -28,6 +28,7 @@
<br /> <br />
<input type="submit" value="Salvar" class="btn btn-primary"/> <input type="submit" value="Salvar" class="btn btn-primary"/>
<input type="submit" id="apagar-expediente" name="apagar-expediente" value="Apagar" class="btn btn-danger" />
</form> </form>
{% endif %} {% endif %}

Loading…
Cancel
Save