diff --git a/sapl/parlamentares/forms.py b/sapl/parlamentares/forms.py index bf7355a88..d8ba0c3c8 100755 --- a/sapl/parlamentares/forms.py +++ b/sapl/parlamentares/forms.py @@ -691,8 +691,9 @@ class BlocoForm(ModelForm): return self.cleaned_data @transaction.atomic - def save(self, commit=True): + def save(self, commit=False): bloco = super(BlocoForm, self).save(commit) + bloco.save() content_type = ContentType.objects.get_for_model(Bloco) object_id = bloco.pk tipo = TipoAutor.objects.get(content_type=content_type) diff --git a/sapl/parlamentares/migrations/0034_auto_20210303_1428.py b/sapl/parlamentares/migrations/0034_auto_20210303_1428.py new file mode 100644 index 000000000..51bb3adfb --- /dev/null +++ b/sapl/parlamentares/migrations/0034_auto_20210303_1428.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.13 on 2021-03-03 17:28 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0033_auto_20210103_1015'), + ] + + operations = [ + migrations.AlterModelOptions( + name='bloco', + options={'ordering': ('nome',), 'verbose_name': 'Bloco Parlamentar', 'verbose_name_plural': 'Blocos Parlamentares'}, + ), + ] diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index f9ced6221..e0d55ebf6 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -665,7 +665,7 @@ class Bloco(models.Model): class Meta: verbose_name = _('Bloco Parlamentar') verbose_name_plural = _('Blocos Parlamentares') - ordering = ('partidos__nome', 'nome') + ordering = ('nome',) def __str__(self): return self.nome diff --git a/sapl/parlamentares/urls.py b/sapl/parlamentares/urls.py index 5cf7b40b6..88a46c69b 100644 --- a/sapl/parlamentares/urls.py +++ b/sapl/parlamentares/urls.py @@ -53,8 +53,6 @@ urlpatterns = [ url(r'^parlamentar/coligacao-legislatura/', coligacao_legislatura, name="coligacao_legislatura"), url(r'^sistema/coligacao/', include(ColigacaoCrud.get_urls() + ComposicaoColigacaoCrud.get_urls())), url(r'^sistema/pesquisar-coligacao/', PesquisarColigacaoView.as_view(), name='pesquisar_coligacao'), - - url(r'^sistema/bloco/', include(BlocoCrud.get_urls())), url(r'^sistema/coligacao/', include(ColigacaoCrud.get_urls() + ComposicaoColigacaoCrud.get_urls())),