From e7c8491499cbc00780d9489ef9fdb9933b309168 Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 9 Oct 2018 17:54:49 -0300 Subject: [PATCH] HOT-FIX: conserta estouro de campo em protocolo (#2291) --- sapl/materia/forms.py | 3 +-- .../migrations/0008_auto_20181009_1741.py | 20 +++++++++++++++++++ sapl/protocoloadm/models.py | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 sapl/protocoloadm/migrations/0008_auto_20181009_1741.py diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 6f6a544cd..b244af69a 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -1855,14 +1855,13 @@ class ConfirmarProposicaoForm(ProposicaoForm): else: # numeracao == 'U' ou não informada nm = Protocolo.objects.all().aggregate(Max('numero')) - protocolo = Protocolo() protocolo.numero = (nm['numero__max'] + 1) if nm['numero__max'] else 1 protocolo.ano = timezone.now().year protocolo.tipo_protocolo = '1' - protocolo.interessado = str(proposicao.autor) + protocolo.interessado = str(proposicao.autor)[:200] # tamanho máximo 200 protocolo.autor = proposicao.autor protocolo.assunto_ementa = proposicao.descricao protocolo.numero_paginas = cd['numero_de_paginas'] diff --git a/sapl/protocoloadm/migrations/0008_auto_20181009_1741.py b/sapl/protocoloadm/migrations/0008_auto_20181009_1741.py new file mode 100644 index 000000000..0ea354a29 --- /dev/null +++ b/sapl/protocoloadm/migrations/0008_auto_20181009_1741.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.13 on 2018-10-09 20:41 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('protocoloadm', '0007_auto_20180924_1724'), + ] + + operations = [ + migrations.AlterField( + model_name='protocolo', + name='interessado', + field=models.CharField(blank=True, max_length=200, verbose_name='Interessado'), + ), + ] diff --git a/sapl/protocoloadm/models.py b/sapl/protocoloadm/models.py index 908aac542..aa4e7c0c2 100644 --- a/sapl/protocoloadm/models.py +++ b/sapl/protocoloadm/models.py @@ -67,7 +67,7 @@ class Protocolo(models.Model): blank=True, null=True, verbose_name=_('Tipo de Protocolo')) tipo_processo = models.PositiveIntegerField() interessado = models.CharField( - max_length=60, blank=True, verbose_name=_('Interessado')) + max_length=200, blank=True, verbose_name=_('Interessado')) autor = models.ForeignKey(Autor, blank=True, null=True,