From ac4486b9439f6bb631f4b1bc08b04fa8a4ca1ce1 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 16 Sep 2015 13:49:54 -0300 Subject: [PATCH] Change get_success_url in sessao/views --- sessao/views.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sessao/views.py b/sessao/views.py index 26d741a4f..eb7810c92 100644 --- a/sessao/views.py +++ b/sessao/views.py @@ -98,6 +98,10 @@ class ExpedienteView(InlineFormSetView): can_delete = True extra = 1 + def get_success_url(self): + pk = self.kwargs['pk'] + return reverse('sessaoplenaria:expediente', kwargs={'pk': pk}) + class PresencaForm(forms.Form): presenca = forms.CharField(required=False, initial=False) @@ -137,7 +141,8 @@ class PresencaView(FormMixin, sessao_crud.CrudDetailView): return self.form_invalid(form) def get_success_url(self): - return self.detail_url + pk = self.kwargs['pk'] + return reverse('sessaoplenaria:presenca', kwargs={'pk': pk}) def get_parlamentares(self): self.object = self.get_object() @@ -197,7 +202,8 @@ class PresencaOrdemDiaView(FormMixin, sessao_crud.CrudDetailView): return self.form_invalid(form) def get_success_url(self): - return self.detail_url + pk = self.kwargs['pk'] + return reverse('sessaoplenaria:presencaordemdia', kwargs={'pk': pk}) def get_parlamentares(self): self.object = self.get_object() @@ -305,7 +311,8 @@ class OradorExpedienteDelete(FormMixin, sessao_crud.CrudDetailView): return self.form_invalid(form) def get_success_url(self): - return self.detail_url + pk = self.kwargs['pk'] + return reverse('sessaoplenaria:oradorexpediente', kwargs={'pk': pk}) class OradorExpedienteEdit(FormMixin, sessao_crud.CrudDetailView): @@ -313,7 +320,8 @@ class OradorExpedienteEdit(FormMixin, sessao_crud.CrudDetailView): form_class = OradorForm def get_success_url(self): - return self.detail_url + pk = self.kwargs['pk'] + return reverse('sessaoplenaria:oradorexpediente', kwargs={'pk': pk}) def post(self, request, *args, **kwargs): self.object = self.get_object() @@ -415,7 +423,8 @@ class OradorExpedienteView(FormMixin, sessao_crud.CrudDetailView): return self.form_invalid(form) def get_success_url(self): - return self.detail_url + pk = self.kwargs['pk'] + return reverse('sessaoplenaria:oradorexpediente', kwargs={'pk': pk}) class MesaForm(forms.Form): @@ -428,7 +437,8 @@ class MesaView(FormMixin, sessao_crud.CrudDetailView): form_class = MesaForm def get_success_url(self): - return self.detail_url + pk = self.kwargs['pk'] + return reverse('sessaoplenaria:mesa', kwargs={'pk': pk}) def post(self, request, *args, **kwargs): self.object = self.get_object()