From 4bd031f6171d5c67aab74a2385a8b1a14d6a27ec Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 7 Mar 2018 14:15:38 -0300 Subject: [PATCH] Ajusta util de listagem de refs a model --- sapl/legacy/scripts/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/legacy/scripts/utils.py b/sapl/legacy/scripts/utils.py index a983ef2b0..40f1abb3c 100644 --- a/sapl/legacy/scripts/utils.py +++ b/sapl/legacy/scripts/utils.py @@ -9,10 +9,10 @@ def getsourcelines(model): for line in inspect.getsourcelines(model)[0]] -def get_models_com_referencia_a_autor(): +def get_models_com_referencia_a(apontado): def tem_referencia_a_autor(model): - return any(getattr(field, 'related_model', None) == Autor + return any(getattr(field, 'related_model', None) == apontado for field in model._meta.get_fields()) return [model for app in appconfs for model in app.models.values()