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()