Skip to content

Commit edd0bef

Browse files
committed
refactor(access): Update is_tenancy_object to check for CenturionModel
ref:
1 parent 9cf8d32 commit edd0bef

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/access/mixins/permissions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from rest_framework.permissions import DjangoObjectPermissions
44

5-
from access.models.tenancy import Tenant, TenancyObject
5+
from access.models.tenancy import Tenant
66

77
from core import exceptions as centurion_exceptions
8+
from core.mixins.centurion import Centurion
89

910

1011

@@ -57,11 +58,11 @@ def is_tenancy_model(self, view) -> bool:
5758

5859
if hasattr(view, 'model'):
5960

60-
self._is_tenancy_model = issubclass(view.model, TenancyObject)
61+
self._is_tenancy_model = issubclass(view.model, Centurion)
6162

6263
if view.get_parent_model():
6364

64-
self._is_tenancy_model = issubclass(view.get_parent_model(), TenancyObject)
65+
self._is_tenancy_model = issubclass(view.get_parent_model(), Centurion)
6566

6667
return self._is_tenancy_model
6768

0 commit comments

Comments
 (0)