Added checks on restrictions
authorThierry Florac <tflorac@ulthar.net>
Sun, 26 Nov 2017 09:54:10 +0100
changeset 286 1a27b43375d6
parent 285 e10f82e4874e
child 287 834b484129fd
Added checks on restrictions
src/pyams_content/shared/common/zmi/security.py
--- a/src/pyams_content/shared/common/zmi/security.py	Sun Nov 26 09:53:31 2017 +0100
+++ b/src/pyams_content/shared/common/zmi/security.py	Sun Nov 26 09:54:10 2017 +0100
@@ -115,7 +115,7 @@
 
     def getValue(self, obj):
         restrictions = IManagerRestrictions(self.context).get_restrictions(obj)
-        if restrictions.restricted_contents:
+        if (restrictions is not None) and restrictions.restricted_contents:
             return '<i class="fa fa-fw fa-check"></i>'
         else:
             return '--'
@@ -132,7 +132,7 @@
 
     def getValue(self, obj):
         restrictions = IManagerRestrictions(self.context).get_restrictions(obj)
-        if restrictions.restricted_contents and restrictions.owners:
+        if (restrictions is not None) and restrictions.restricted_contents and restrictions.owners:
             return '<i class="fa fa-fw fa-check"></i>'
         else:
             return '--'