From 76daec32b52a6c95396876e4024224c0eae9aa96 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 17 Jan 2025 02:27:12 +0930 Subject: [PATCH] chore(access): Add trace output for tests that pass locally and fail on GH actions ref: #469 #471 --- app/access/models.py | 9 +++++++++ .../config_groups/test_config_groups_viewset.py | 4 ++++ 2 files changed, 13 insertions(+) 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: diff --git a/app/config_management/tests/functional/config_groups/test_config_groups_viewset.py b/app/config_management/tests/functional/config_groups/test_config_groups_viewset.py index e1894b52b..f07111d2a 100644 --- a/app/config_management/tests/functional/config_groups/test_config_groups_viewset.py +++ b/app/config_management/tests/functional/config_groups/test_config_groups_viewset.py @@ -73,6 +73,10 @@ def setUpTestData(self): app_settings.save() + print(f'[TRACE] global org: {self.global_organization.id}') + + print(f'[TRACE] app_settings global org: {app_settings.global_organization}') +