From 7bdc8f9741cdd308cebf651c69d384f61bea6d88 Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Fri, 14 Oct 2016 11:47:44 -0300 Subject: [PATCH] HOT-FIX: Corrige erro inserido em ffcf627 --- sapl/crud/base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sapl/crud/base.py b/sapl/crud/base.py index 19781c0c6..b1b4d3639 100644 --- a/sapl/crud/base.py +++ b/sapl/crud/base.py @@ -238,6 +238,14 @@ class CrudBaseMixin(CrispyLayoutFormMixin): self.permission_required = tuple(( self.permission(pr) for pr in self.permission_required)) + if not hasattr(obj, 'públic'): + obj.public = list( + set(self.permission_required) - + set((RP_LIST, RP_DETAIL, RP_ADD, RP_CHANGE, RP_DELETE))) + + else: + obj.public = [] + @classmethod def url_name(cls, suffix): return '%s_%s' % (cls.model._meta.model_name, suffix)