From 0053eafd7856def20778165dfc2e04e4780fcd42 Mon Sep 17 00:00:00 2001 From: eribeiro Date: Thu, 4 Mar 2021 12:22:49 -0300 Subject: [PATCH] Ajustes em Forms --- sapl/parlamentares/forms.py | 2 +- .../migrations/0055_auto_20210304_1221.py | 17 +++++++++++++++++ sapl/sessao/models.py | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 sapl/sessao/migrations/0055_auto_20210304_1221.py diff --git a/sapl/parlamentares/forms.py b/sapl/parlamentares/forms.py index f7c813188..e93a80dc8 100755 --- a/sapl/parlamentares/forms.py +++ b/sapl/parlamentares/forms.py @@ -491,7 +491,7 @@ class FrenteForm(ModelForm): if not self.is_valid(): return self.cleaned_data - if cd['data_extincao'] and cd['data_criacao'] >= cd['data_extincao']: + if cd['data_extincao'] and cd['data_criacao'] > cd['data_extincao']: self.logger.error("Data Dissolução ({}) não pode ser anterior a Data Criação ({})." .format(cd['data_extincao'], cd['data_criacao'])) raise ValidationError( diff --git a/sapl/sessao/migrations/0055_auto_20210304_1221.py b/sapl/sessao/migrations/0055_auto_20210304_1221.py new file mode 100644 index 000000000..f5f21d9ae --- /dev/null +++ b/sapl/sessao/migrations/0055_auto_20210304_1221.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.13 on 2021-03-04 15:21 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('sessao', '0054_auto_20201013_1053'), + ] + + operations = [ + migrations.AlterModelOptions( + name='bancada', + options={'ordering': ('-legislatura__numero', 'nome'), 'verbose_name': 'Bancada Parlamentar', 'verbose_name_plural': 'Bancadas Parlamentares'}, + ), + ] diff --git a/sapl/sessao/models.py b/sapl/sessao/models.py index 77fbfb72d..47019abdb 100644 --- a/sapl/sessao/models.py +++ b/sapl/sessao/models.py @@ -68,7 +68,7 @@ class Bancada(models.Model): class Meta: verbose_name = _('Bancada Parlamentar') verbose_name_plural = _('Bancadas Parlamentares') - ordering = ('-legislatura__numero', ) + ordering = ('-legislatura__numero', 'nome') def __str__(self): return self.nome