Browse Source

Impede o acesso do superusuario às proposicoes

pull/579/head
Eduardo Calil 8 years ago
parent
commit
2dfea64899
  1. 17
      sapl/materia/admin.py

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

Loading…
Cancel
Save