Browse Source

HOT-FIX: bug em Bloco Parlamentar

pull/3369/head
eribeiro 4 years ago
parent
commit
664576bdf8
  1. 3
      sapl/parlamentares/forms.py
  2. 17
      sapl/parlamentares/migrations/0034_auto_20210303_1428.py
  3. 2
      sapl/parlamentares/models.py
  4. 2
      sapl/parlamentares/urls.py

3
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)

17
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'},
),
]

2
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

2
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())),

Loading…
Cancel
Save