Edward
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
13 additions and
0 deletions
-
sapl/materia/apps.py
-
sapl/materia/receivers.py
|
|
@ -6,3 +6,6 @@ class AppConfig(apps.AppConfig): |
|
|
|
name = 'sapl.materia' |
|
|
|
label = 'materia' |
|
|
|
verbose_name = _('Matéria') |
|
|
|
|
|
|
|
def ready(self): |
|
|
|
from . import receivers |
|
|
@ -1,5 +1,7 @@ |
|
|
|
from django.db.models.signals import post_delete, post_save |
|
|
|
from django.dispatch import receiver |
|
|
|
|
|
|
|
from sapl.materia.models import Tramitacao |
|
|
|
from sapl.materia.signals import tramitacao_signal |
|
|
|
from sapl.utils import get_base_url |
|
|
|
|
|
|
@ -17,3 +19,11 @@ def handle_tramitacao_signal(sender, **kwargs): |
|
|
|
materia, |
|
|
|
tramitacao.status, |
|
|
|
tramitacao.unidade_tramitacao_destino) |
|
|
|
|
|
|
|
|
|
|
|
@receiver(post_delete, sender=Tramitacao) |
|
|
|
def status_tramitacao_materia(sender, instance, **kwargs): |
|
|
|
if instance.turno == 'F': |
|
|
|
materia = instance.materia |
|
|
|
materia.em_tramitacao = True |
|
|
|
materia.save() |
|
|
|