Skip to content

Commit

Permalink
chore(access): Add trace output for tests that pass locally and fail …
Browse files Browse the repository at this point in the history
…on GH actions

ref: #469 #471
  • Loading branch information
jon-nfc committed Jan 16, 2025
1 parent 9d776e1 commit 1b34bd7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/access/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 1b34bd7

Please sign in to comment.