Browse Source

Conserta outro bug em documento administrativo

pull/663/head
Eduardo Calil 8 years ago
parent
commit
903a025035
  1. 6
      sapl/base/templatetags/common_tags.py
  2. 15
      sapl/protocoloadm/views.py

6
sapl/base/templatetags/common_tags.py

@ -95,11 +95,7 @@ def get_doc_adm_template_perms(user):
if app_config.documentos_administrativos == 'O':
return True
if user.has_perms(permissoes_adm()):
return True
else:
return False
return user.has_perms(permissoes_adm())
@register.filter

15
sapl/protocoloadm/views.py

@ -68,10 +68,11 @@ class DocumentoAdministrativoCrud(Crud):
def has_permission(self):
app_config = AppConfig.objects.last()
if app_config:
if app_config.documentos_administrativos == 'O':
return True
else:
perms = self.get_permission_required()
return self.request.user.has_perms(perms)
@ -80,10 +81,11 @@ class DocumentoAdministrativoCrud(Crud):
def has_permission(self):
app_config = AppConfig.objects.last()
if app_config:
if app_config.documentos_administrativos == 'O':
return True
else:
perms = self.get_permission_required()
return self.request.user.has_perms(perms)
@ -400,10 +402,11 @@ class PesquisarDocumentoAdministrativoView(PermissionRequiredMixin,
def has_permission(self):
app_config = AppConfig.objects.last()
if app_config:
if app_config.documentos_administrativos == 'O':
return True
else:
perms = self.get_permission_required()
return self.request.user.has_perms(perms)
@ -621,10 +624,11 @@ class TramitacaoAdmCrud(MasterDetailCrud):
def has_permission(self):
app_config = AppConfig.objects.last()
if app_config:
if app_config.documentos_administrativos == 'O':
return True
else:
perms = self.get_permission_required()
return self.request.user.has_perms(perms)
@ -633,10 +637,11 @@ class TramitacaoAdmCrud(MasterDetailCrud):
def has_permission(self):
app_config = AppConfig.objects.last()
if app_config:
if app_config.documentos_administrativos == 'O':
return True
else:
perms = self.get_permission_required()
return self.request.user.has_perms(perms)

Loading…
Cancel
Save