|
@ -231,14 +231,12 @@ class OradorExpedienteDelete(FormMixin, sessao_crud.CrudDetailView): |
|
|
|
|
|
|
|
|
def post(self, request, *args, **kwargs): |
|
|
def post(self, request, *args, **kwargs): |
|
|
self.object = self.get_object() |
|
|
self.object = self.get_object() |
|
|
current_url = request.get_full_path() |
|
|
|
|
|
words = current_url.split('/') |
|
|
|
|
|
form = OradorDeleteForm(request.POST) |
|
|
form = OradorDeleteForm(request.POST) |
|
|
|
|
|
|
|
|
if form.is_valid(): |
|
|
if form.is_valid(): |
|
|
orador = OradorExpediente.objects.get( |
|
|
orador = OradorExpediente.objects.get( |
|
|
sessao_plenaria_id=self.object.id, |
|
|
sessao_plenaria_id=self.object.id, |
|
|
parlamentar_id=words[-1]) |
|
|
parlamentar_id=kwargs['oid']) |
|
|
orador.delete() |
|
|
orador.delete() |
|
|
return self.form_valid(form) |
|
|
return self.form_valid(form) |
|
|
else: |
|
|
else: |
|
|