fix(access): if permission_required attribute doesn't exist during permission check, return empty list

ref: #346
This commit is contained in:
2024-10-14 01:05:17 +09:30
parent 32d5008f63
commit a1625517d1

View File

@ -136,6 +136,10 @@ class OrganizationMixin():
Override of 'PermissionRequiredMixin' method so that this mixin can obtain the required permission.
"""
if not hasattr(self, 'permission_required'):
return []
if self.permission_required is None:
raise ImproperlyConfigured(
f"{self.__class__.__name__} is missing the "