From 2dfea6489981cb0c9ef126bb2964b44d0b2b311d Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Tue, 13 Sep 2016 16:14:03 -0300 Subject: [PATCH] =?UTF-8?q?Impede=20o=20acesso=20do=20superusuario=20?= =?UTF-8?q?=C3=A0s=20proposicoes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/materia/admin.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sapl/materia/admin.py b/sapl/materia/admin.py index 5c02ebd40..333e64a7a 100644 --- a/sapl/materia/admin.py +++ b/sapl/materia/admin.py @@ -1,3 +1,20 @@ +from django.contrib import admin +from sapl.materia.models import Proposicao +from sapl.settings import DEBUG from sapl.utils import register_all_models_in_admin register_all_models_in_admin(__name__) + +DEBUG = False +if not DEBUG: + + admin.site.unregister(Proposicao) + + class ProposicaoAdmin(admin.ModelAdmin): + def has_change_permission(self, request, obj=None): + return False + + def has_delete_permission(self, request, obj=None): + return False + + admin.site.register(Proposicao, ProposicaoAdmin)