|
@ -258,9 +258,10 @@ class ParlamentaresDependentesEditView(FormMixin, GenericView): |
|
|
parlamentar = Parlamentar.objects.get(id=kwargs['pk']) |
|
|
parlamentar = Parlamentar.objects.get(id=kwargs['pk']) |
|
|
|
|
|
|
|
|
if form.is_valid(): |
|
|
if form.is_valid(): |
|
|
|
|
|
|
|
|
if 'salvar' in request.POST: |
|
|
if 'salvar' in request.POST: |
|
|
dependente.save() |
|
|
dependente.save() |
|
|
elif 'Excluir' in request.POST: |
|
|
elif 'excluir' in request.POST: |
|
|
dependente.delete() |
|
|
dependente.delete() |
|
|
return self.form_valid(form) |
|
|
return self.form_valid(form) |
|
|
else: |
|
|
else: |
|
@ -547,7 +548,7 @@ class FiliacaoEditView(FormMixin, GenericView): |
|
|
candidato_filiado = Filiacao.objects.filter( |
|
|
candidato_filiado = Filiacao.objects.filter( |
|
|
parlamentar=parlamentar) |
|
|
parlamentar=parlamentar) |
|
|
|
|
|
|
|
|
if 'Excluir' in request.POST: |
|
|
if 'excluir' in request.POST: |
|
|
filiacao.delete() |
|
|
filiacao.delete() |
|
|
return self.form_valid(form) |
|
|
return self.form_valid(form) |
|
|
|
|
|
|
|
@ -610,7 +611,7 @@ class FiliacaoEditView(FormMixin, GenericView): |
|
|
|
|
|
|
|
|
if 'salvar' in request.POST: |
|
|
if 'salvar' in request.POST: |
|
|
filiacao.save() |
|
|
filiacao.save() |
|
|
elif 'Excluir' in request.POST: |
|
|
elif 'excluir' in request.POST: |
|
|
filiacao.delete() |
|
|
filiacao.delete() |
|
|
return self.form_valid(form) |
|
|
return self.form_valid(form) |
|
|
|
|
|
|
|
@ -694,7 +695,7 @@ class MandatoEditView(FormMixin, GenericView): |
|
|
if form.is_valid(): |
|
|
if form.is_valid(): |
|
|
if 'salvar' in request.POST: |
|
|
if 'salvar' in request.POST: |
|
|
mandato.save() |
|
|
mandato.save() |
|
|
elif 'Excluir' in request.POST: |
|
|
elif 'excluir' in request.POST: |
|
|
mandato.delete() |
|
|
mandato.delete() |
|
|
return self.form_valid(form) |
|
|
return self.form_valid(form) |
|
|
else: |
|
|
else: |
|
|