refactor(access): Rename model Organization -> Tenant

ref: #756 #505
This commit is contained in:
2025-05-14 23:22:48 +09:30
parent 2e49de8573
commit 2d7335ff85
348 changed files with 1107 additions and 651 deletions

View File

@ -3,7 +3,7 @@ import django
from django.contrib.auth.models import Group
from django.db import models
from access.models.organization import Organization
from access.models.tenant import Tenant as Organization
from access.models.team import Team
User = django.contrib.auth.get_user_model()
@ -93,7 +93,7 @@ class OrganizationMixin:
self._obj_organization = obj.organization
elif str(self.model._meta.verbose_name).lower() == 'organization':
elif str(self.model._meta.verbose_name).lower() == 'tenant':
self._obj_organization = obj

View File

@ -5,7 +5,7 @@ from django.core.exceptions import ObjectDoesNotExist
from rest_framework import exceptions
from rest_framework.permissions import DjangoObjectPermissions
from access.models.tenancy import Organization, TenancyObject
from access.models.tenancy import Tenant, TenancyObject
from core import exceptions as centurion_exceptions
@ -14,10 +14,10 @@ from core import exceptions as centurion_exceptions
class OrganizationPermissionMixin(
DjangoObjectPermissions,
):
"""Organization Permission Mixin
"""Tenant Permission Mixin
This class is to be used as the permission class for API `Views`/`ViewSets`.
In combination with the `OrganizationPermissionsMixin`, permission checking
In combination with the `TenantPermissionsMixin`, permission checking
will be done to ensure the user has the correct permissions to perform the
CRUD operation.
@ -166,7 +166,7 @@ class OrganizationPermissionMixin(
raise centurion_exceptions.PermissionDenied()
obj_organization: Organization = view.get_obj_organization(
obj_organization: Tenant = view.get_obj_organization(
request = request
)