From b58f237b3e41622fc17cd023c48ade3aaa031f22 Mon Sep 17 00:00:00 2001 From: AlGouvea Date: Tue, 27 Jul 2021 11:43:57 -0300 Subject: [PATCH] Retirado qualquer caso de aito referencia em get_notificacoes --- sapl/compilacao/views.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sapl/compilacao/views.py b/sapl/compilacao/views.py index 29c00952f..8a10ca705 100644 --- a/sapl/compilacao/views.py +++ b/sapl/compilacao/views.py @@ -236,16 +236,16 @@ class CompMixin(PermissionRequiredMixin): return context def get_notificacoes(self, object_list=None, type_notificacoes=None): - p = [] def padd(r, type_notificacao, reverse_url=None, test=True, msg='', kwargs=None, to_position=None): - if not test: return - r.contextual_class = type_notificacao + if r is not None: + r.contextual_class = type_notificacao + if not kwargs: kwargs = {'ta_id': r.ta_id, 'pk': r.pk} if reverse_url: @@ -427,6 +427,10 @@ class CompMixin(PermissionRequiredMixin): rr.append(r) if r.dispositivos_alterados_set.exists(): + if r in r.dispositivos_alterados_set.all(): + r.dispositivos_alterados_set.all().exclude(r) + + rr += self.get_notificacoes( r.dispositivos_alterados_set.all(), type_notificacoes)