From f645f705468216e918483659ba04bdc3c744cd1a Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Wed, 28 Sep 2016 09:29:25 -0300 Subject: [PATCH] Conserta bug em permissoes de documento admnistrativo --- sapl/base/templatetags/common_tags.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index a157010dd..ce83e020c 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -90,9 +90,12 @@ def get_delete_perm(value, arg): @register.filter def get_doc_adm_template_perms(user): app_config = AppConfig.objects.last() - if app_config.documentos_administrativos == 'O': - return True - elif user.has_perms(permissoes_adm()): + + if app_config: + if app_config.documentos_administrativos == 'O': + return True + + if user.has_perms(permissoes_adm()): return True else: