From c908df84910b19c691e38f9c3219e18d5fdadc03 Mon Sep 17 00:00:00 2001 From: Talitha Pumar Date: Tue, 27 Feb 2018 14:45:56 -0300 Subject: [PATCH] 1718 remover acesso dos models de tipos (#1719) * Fixes #1718 --- sapl/materia/admin.py | 24 ++++++++++++++++--- sapl/templates/materia/proposicao_detail.html | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/sapl/materia/admin.py b/sapl/materia/admin.py index 8da7408b1..65b754817 100644 --- a/sapl/materia/admin.py +++ b/sapl/materia/admin.py @@ -1,5 +1,11 @@ from django.contrib import admin -from sapl.materia.models import Proposicao +from sapl.materia.models import Proposicao, TipoMateriaLegislativa +from sapl.base.models import TipoAutor +from sapl.comissoes.models import TipoComissao +from sapl.parlamentares.models import TipoAfastamento, SituacaoMilitar, TipoDependente +from sapl.norma.models import TipoNormaJuridica, TipoVinculoNormaJuridica +from sapl.sessao.models import TipoSessaoPlenaria, TipoExpediente, TipoResultadoVotacao +from sapl.protocoloadm.models import TipoDocumentoAdministrativo from sapl.settings import DEBUG from sapl.utils import register_all_models_in_admin @@ -8,8 +14,14 @@ register_all_models_in_admin(__name__) if not DEBUG: admin.site.unregister(Proposicao) + admin.site.unregister(TipoAutor) + admin.site.unregister(TipoComissao) + admin.site.unregister(TipoAfastamento) + admin.site.unregister(SituacaoMilitar) + admin.site.unregister(TipoDependente) - class ProposicaoAdmin(admin.ModelAdmin): + + class RestricaoAdmin(admin.ModelAdmin): def has_add_permission(self, request, obj=None): return False @@ -20,4 +32,10 @@ if not DEBUG: def has_delete_permission(self, request, obj=None): return False - admin.site.register(Proposicao, ProposicaoAdmin) + + admin.site.register(Proposicao, RestricaoAdmin) + admin.site.register(TipoAutor, RestricaoAdmin) + admin.site.register(TipoComissao, RestricaoAdmin) + admin.site.register(TipoAfastamento, RestricaoAdmin) + admin.site.register(SituacaoMilitar, RestricaoAdmin) + admin.site.register(TipoDependente, RestricaoAdmin) diff --git a/sapl/templates/materia/proposicao_detail.html b/sapl/templates/materia/proposicao_detail.html index 23500e739..53d6e8620 100644 --- a/sapl/templates/materia/proposicao_detail.html +++ b/sapl/templates/materia/proposicao_detail.html @@ -136,7 +136,7 @@ {% endif %} - + {% if not AppConfig.receber_recibo_proposicao %} {% if object.hash_code %}