diff --git a/app/access/models.py b/app/access/models.py index 180352c80..b93c7c798 100644 --- a/app/access/models.py +++ b/app/access/models.py @@ -179,18 +179,26 @@ def get_queryset(self): user_organizations: list(str()) = [] + print(f'current app settings {self._app_settings}') + if request: if not self._app_settings: + print(f'no cached app settings') + from settings.models.app_settings import AppSettings self._app_settings = AppSettings.objects.prefetch_related('global_organization').get( owner_organization = None ) + print(f'app settings cached') + if self._app_settings.global_organization: + print(f'adding global organization') + user_organizations += [ self._app_settings.global_organization.id ] # user = request.user._wrapped if hasattr(request.user,'_wrapped') else request.user @@ -212,6 +220,7 @@ def get_queryset(self): user_organizations += [ team_user.team.organization.id ] + print(f'user orgs: {user_organizations}') # if len(user_organizations) > 0 and not user.is_superuser and self.model.is_global is not None: if len(user_organizations) > 0 and not user.is_superuser: