Skip to content

Commit

Permalink
Fix #2447
Browse files Browse the repository at this point in the history
  • Loading branch information
LeandroJatai committed Jan 9, 2019
1 parent 9869d4d commit e9d6420
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions sapl/materia/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import sapl
from sapl.base.email_utils import do_envia_email_confirmacao
from sapl.base.models import Autor, CasaLegislativa
from sapl.base.models import Autor, CasaLegislativa, AppConfig as BaseAppConfig
from sapl.base.signals import tramitacao_signal
from sapl.comissoes.models import Comissao, Participacao
from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_RESTRICT,
Expand Down Expand Up @@ -783,16 +783,23 @@ def get(self, request, *args, **kwargs):
msg_error = _('Proposição não possui nenhum tipo de '
'Texto associado.')
else:
p.data_devolucao = None
p.data_envio = timezone.now()
p.save()

if p.texto_articulado.exists():
ta = p.texto_articulado.first()
ta.privacidade = STATUS_TA_IMMUTABLE_RESTRICT
ta.editing_locked = True
ta.save()

receber_recibo = BaseAppConfig.attr(
'receber_recibo_proposicao')

if not receber_recibo:
ta = p.texto_articulado.first()
p.hash_code = 'P' + ta.hash() + SEPARADOR_HASH_PROPOSICAO + str(p.pk)

p.data_devolucao = None
p.data_envio = timezone.now()
p.save()

messages.success(request, _(
'Proposição enviada com sucesso.'))
try:
Expand Down

0 comments on commit e9d6420

Please sign in to comment.