Browse Source

Fix #875

pull/878/head
Eduardo Edson Batista Cordeiro Alves 8 years ago
parent
commit
e58d6affc2
  1. 4
      sapl/sessao/forms.py
  2. 10
      sapl/sessao/views.py

4
sapl/sessao/forms.py

@ -93,7 +93,7 @@ class ExpedienteMateriaForm(ModelForm):
return self.cleaned_data['numero_ordem']
def clean_data_ordem(self):
return datetime.now()
return self.instance.sessao_plenaria.data_inicio
def clean(self):
cleaned_data = self.cleaned_data
@ -136,7 +136,7 @@ class OrdemDiaForm(ExpedienteMateriaForm):
'numero_materia', 'ano_materia', 'tipo_votacao']
def clean_data_ordem(self):
return datetime.now()
return self.instance.sessao_plenaria.data_inicio
def clean(self):
cleaned_data = self.cleaned_data

10
sapl/sessao/views.py

@ -133,6 +133,11 @@ class MateriaOrdemDiaCrud(MasterDetailCrud):
class CreateView(MasterDetailCrud.CreateView):
form_class = OrdemDiaForm
def get_initial(self):
self.initial['data_ordem'] = SessaoPlenaria.objects.get(
pk=self.kwargs['pk']).data_inicio.strftime('%d/%m/%Y')
return self.initial
def get_success_url(self):
return reverse('sapl.sessao:ordemdia_list',
kwargs={'pk': self.kwargs['pk']})
@ -331,6 +336,11 @@ class ExpedienteMateriaCrud(MasterDetailCrud):
class CreateView(MasterDetailCrud.CreateView):
form_class = ExpedienteMateriaForm
def get_initial(self):
self.initial['data_ordem'] = SessaoPlenaria.objects.get(
pk=self.kwargs['pk']).data_inicio.strftime('%d/%m/%Y')
return self.initial
def get_success_url(self):
return reverse('sapl.sessao:expedientemateria_list',
kwargs={'pk': self.kwargs['pk']})

Loading…
Cancel
Save