Browse Source

Merge pull request #1103 from interlegis/1102-nome-comissao-autor

fix #1102 -  Nome da comissão em autor
pull/1107/head
Luciano Henrique Nunes de Almeida 8 years ago
committed by GitHub
parent
commit
4195e471b9
  1. 20
      sapl/base/migrations/0003_auto_20170519_1106.py
  2. 2
      sapl/base/models.py
  3. 1
      sapl/legacy/migration.py

20
sapl/base/migrations/0003_auto_20170519_1106.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-05-19 11:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0002_auto_20170331_1900'),
]
operations = [
migrations.AlterField(
model_name='autor',
name='nome',
field=models.CharField(blank=True, max_length=60, verbose_name='Nome do Autor'),
),
]

2
sapl/base/models.py

@ -211,7 +211,7 @@ class Autor(models.Model):
autor_related = GenericForeignKey('content_type', 'object_id')
nome = models.CharField(
max_length=50, blank=True, verbose_name=_('Nome do Autor'))
max_length=60, blank=True, verbose_name=_('Nome do Autor'))
cargo = models.CharField(max_length=50, blank=True)

1
sapl/legacy/migration.py

@ -723,6 +723,7 @@ def adjust_autor(new, old):
new.nome = new.autor_related.nome_parlamentar
elif old.cod_comissao:
new.autor_related = Comissao.objects.get(pk=old.cod_comissao)
new.nome = new.autor_related.nome
if old.col_username:
if not get_user_model().objects.filter(

Loading…
Cancel
Save