From 4ba93c42239292e49a533f708c8af3c0fa0878f6 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Wed, 5 Oct 2016 11:56:27 -0300 Subject: [PATCH] Resolve pontos levantados sobre a criacao de sessao --- sapl/sessao/views.py | 5 +---- sapl/templates/sessao/sessaoplenaria_form.html | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 2edf41e1c..fef41ce94 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -434,10 +434,7 @@ class SessaoCrud(Crud): def get_initial(self): legislatura = Legislatura.objects.order_by('-data_inicio')[0] - sessao_legislativa = SessaoLegislativa.objects.order_by( - '-data_inicio')[0] - return {'legislatura': legislatura, - 'sessao_legislativa': sessao_legislativa} + return {'legislatura': legislatura} class SessaoPermissionMixin(PermissionRequiredForAppCrudMixin, diff --git a/sapl/templates/sessao/sessaoplenaria_form.html b/sapl/templates/sessao/sessaoplenaria_form.html index 49e88441a..3d2f9c62b 100644 --- a/sapl/templates/sessao/sessaoplenaria_form.html +++ b/sapl/templates/sessao/sessaoplenaria_form.html @@ -36,6 +36,7 @@ $.get("/sessao-legislativa-legislatura-ajax", {legislatura: id_legislatura}, function(data) { lista_sessoes = data['sessao_legislativa']; + $('#id_sessao_legislativa').append(''); for (i = 0; i < lista_sessoes.length; i++) { $('#id_sessao_legislativa').append(''); } @@ -56,6 +57,7 @@ $.get("/sessao-legislativa-legislatura-ajax", {legislatura: id_legislatura}, function(data) { lista_sessoes = data['sessao_legislativa']; + $('#id_sessao_legislativa').append(''); for (i = 0; i < lista_sessoes.length; i++) { $('#id_sessao_legislativa').append(''); } @@ -67,6 +69,7 @@ } }); }) + {% endblock %}