From 85ece5b28add46da4af9fddea32cf47950c2c9ef Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Wed, 2 Aug 2017 17:29:11 -0300 Subject: [PATCH] =?UTF-8?q?Verifica=20rela=C3=A7=C3=A3o=20entre=20parlamen?= =?UTF-8?q?tares=20e=20autores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 8878d3522..b5e16e282 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -327,6 +327,9 @@ def obj_desnecessario(obj): if (f.one_to_many or f.one_to_one) and f.auto_created] sem_referencia = not any(rr.related_model.objects.filter( **{rr.field.name: obj}).exists() for rr in relacoes) + if type(obj).__name__ == 'Parlamentar' and sem_referencia and \ + obj.autor.all(): + sem_referencia = False return sem_referencia