Browse Source

Data obrigatoria em documentos acessorios (#1379)

pull/1383/head
Rogério Frá 7 years ago
committed by Edward
parent
commit
4a89630b04
  1. 1
      sapl/materia/forms.py
  2. 1
      sapl/materia/tests/test_materia.py
  3. 5
      sapl/materia/views.py

1
sapl/materia/forms.py

@ -164,6 +164,7 @@ class AcompanhamentoMateriaForm(ModelForm):
class DocumentoAcessorioForm(ModelForm):
data = forms.DateField(required=True)
class Meta:
model = DocumentoAcessorio

1
sapl/materia/tests/test_materia.py

@ -226,6 +226,7 @@ def test_documento_acessorio_submit(admin_client):
'data_materia': '2016-03-21',
'autor': autor,
'ementa': 'teste_ementa',
'data': '2016-03-21',
'salvar': 'salvar'},
follow=True)

5
sapl/materia/views.py

@ -1061,6 +1061,11 @@ class DocumentoAcessorioCrud(MasterDetailCrud):
def __init__(self, **kwargs):
super(MasterDetailCrud.CreateView, self).__init__(**kwargs)
def get_initial(self):
self.initial['data'] = datetime.now().date()
return self.initial
def get_context_data(self, **kwargs):
context = super(

Loading…
Cancel
Save