Browse Source

HOT-FIX: conserta estouro de campo em protocolo (#2291)

pull/2299/head
Edward 6 years ago
committed by GitHub
parent
commit
e7c8491499
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      sapl/materia/forms.py
  2. 20
      sapl/protocoloadm/migrations/0008_auto_20181009_1741.py
  3. 2
      sapl/protocoloadm/models.py

3
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']

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

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

Loading…
Cancel
Save