Browse Source

Revert "Fix #1566 (#1739)"

This reverts commit e7c1aa5879.
pull/1744/head
LeandroRoberto 7 years ago
parent
commit
bcc7344876
  1. 18
      sapl/comissoes/forms.py
  2. 1
      sapl/comissoes/legacy.yaml
  3. 29
      sapl/comissoes/migrations/0010_auto_20180307_1645.py
  4. 16
      sapl/comissoes/migrations/0011_merge.py
  5. 12
      sapl/comissoes/models.py
  6. 1
      sapl/materia/forms.py
  7. 5
      sapl/templates/comissoes/layouts.yaml
  8. 1
      sapl/templates/comissoes/subnav.yaml

18
sapl/comissoes/forms.py

@ -10,7 +10,6 @@ from sapl.comissoes.models import Comissao, Composicao, Participacao, Reuniao
from sapl.parlamentares.models import Legislatura, Mandato, Parlamentar
class ParticipacaoCreateForm(forms.ModelForm):
parent_pk = forms.CharField(required=False) # widget=forms.HiddenInput())
@ -155,13 +154,20 @@ class ReuniaoForm(ModelForm):
class Meta:
model = Reuniao
exclude = ['cod_andamento_reuniao']
widgets = {
'hora_fim': forms.TimeInput(format='%H:%M'),
'hora_inicio': forms.TimeInput(format='%H:%M'),
}
def clean(self):
super(ReuniaoForm, self).clean()
if self.cleaned_data['hora_fim']:
if (self.cleaned_data['hora_fim'] <
self.cleaned_data['hora_inicio']):
msg = _('A hora de término da reunião não pode ser menor que a de início')
raise ValidationError(msg)
if self.errors:
return
if self.cleaned_data['hora_fim'] < self.cleaned_data['hora_inicio']:
msg = _('A hora de término da reunião não pode '
'ser menor que a de início')
raise ValidationError(msg)
return self.cleaned_data

1
sapl/comissoes/legacy.yaml

@ -47,6 +47,7 @@ Participacao (ComposicaoComissao):
Reuniao:
periodo: periodo_reuniao
comissao: cod_comissao
tipo: tipo_comissao
numero: num_comissao
nome: nom_reuniao
tema: tem_reuniao

29
sapl/comissoes/migrations/0010_auto_20180307_1645.py

@ -1,29 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-07 19:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comissoes', '0009_auto_20180301_1011'),
]
operations = [
migrations.RemoveField(
model_name='reuniao',
name='tipo',
),
migrations.AlterField(
model_name='reuniao',
name='nome',
field=models.CharField(max_length=150, verbose_name='Nome da Reunião'),
),
migrations.AlterField(
model_name='reuniao',
name='tema',
field=models.CharField(blank=True, max_length=150, verbose_name='Tema da Reunião'),
),
]

16
sapl/comissoes/migrations/0011_merge.py

@ -1,16 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-09 10:27
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('comissoes', '0010_auto_20180307_1645'),
('comissoes', '0010_auto_20180306_0918'),
]
operations = [
]

12
sapl/comissoes/models.py

@ -182,13 +182,15 @@ class Participacao(models.Model): # ComposicaoComissao
def get_comissao_media_path(instance, subpath, filename):
return './sapl/comissao/%s/%s/%s' % (instance.numero, subpath, filename)
def pauta_upload_path(instance, filename):
def pauta_upload_path(instance, filename):
return texto_upload_path(instance, filename, subpath='pauta', pk_first=True)
def ata_upload_path(instance, filename):
return texto_upload_path(instance, filename, subpath='ata', pk_first=True)
def anexo_upload_path(instance, filename):
return texto_upload_path(instance, filename, subpath='anexo', pk_first=True)
@ -202,11 +204,15 @@ class Reuniao(models.Model):
Comissao,
on_delete=models.PROTECT,
verbose_name=_('Comissão'))
tipo = models.ForeignKey(
TipoComissao,
on_delete=models.PROTECT,
verbose_name=_('Tipo de Comissão'))
numero = models.PositiveIntegerField(verbose_name=_('Número'))
nome = models.CharField(
max_length=150, verbose_name=_('Nome da Reunião'))
max_length=100, verbose_name=_('Nome da Reunião'))
tema = models.CharField(
max_length=150, blank=True, verbose_name=_('Tema da Reunião'))
max_length=100, verbose_name=_('Tema da Reunião'))
data = models.DateField(verbose_name=_('Data'))
hora_inicio = models.TimeField(
verbose_name=_('Horário de Início (hh:mm)'))

1
sapl/materia/forms.py

@ -1265,7 +1265,6 @@ class ProposicaoForm(forms.ModelForm):
inst.texto_original.delete()
self.gerar_hash(inst, receber_recibo)
return super().save(commit)
inst.ano = timezone.now().year

5
sapl/templates/comissoes/layouts.yaml

@ -46,10 +46,11 @@ ParticipacaoEdit:
Reuniao:
{% trans 'Reunião' %}:
- periodo numero
- periodo numero tipo
- nome tema local_reuniao
- data hora_inicio hora_fim
- url_video url_audio
- observacao
- upload_pauta upload_ata upload_anexo
- comissao
- comissao

1
sapl/templates/comissoes/subnav.yaml

@ -8,4 +8,3 @@
url: materias_em_tramitacao
- title: {% trans 'Reunião' %}
url: reuniao_list

Loading…
Cancel
Save