Organization tenancy and frontend #16

Merged
rixx merged 26 commits from 6-organizations into main 2025-03-21 12:32:53 +00:00
Showing only changes of commit da82b459bd - Show all commits

View file

@ -1,6 +1,6 @@
from django.shortcuts import get_object_or_404
from django.urls import resolve
from django_scopes import scope
from django_scopes import scope, scopes_disabled
from servala.core.models import Organization
@ -13,6 +13,10 @@ class OrganizationMiddleware:
def __call__(self, request):
url = resolve(request.path_info)
if "admin" in url.namespaces:
with scopes_disabled():
return self.get_response(request)
organization_slug = url.kwargs.get("organization")
if organization_slug:
pk = organization_slug.rsplit("-", maxsplit=1)[-1]