refactor(access): add to models a get_organization function

!13
This commit is contained in:
2024-05-29 09:39:55 +09:30
parent a9ea173e74
commit dd0eaae6b3
2 changed files with 14 additions and 9 deletions

View File

@ -24,17 +24,11 @@ class OrganizationMixin():
self.get_object()
if 'access.models.Organization' in str(type(self.get_object())):
id = self.get_object().get_organization().id
id = self.get_object().id
if self.get_object().is_global:
else:
id = self.get_object().organization.id
if self.get_object().is_global:
id = 0
id = 0
except AttributeError: