From 98d990d7af754d44d70a215bc20ded08eb5135b5 Mon Sep 17 00:00:00 2001 From: Robert Raposa Date: Fri, 20 May 2022 13:42:12 -0400 Subject: [PATCH] fix: remove reference to ApplicationOrganization (#30446) References to ApplicationOrganization were removed two years ago in the following PR: https://github.com/openedx/edx-platform/pull/23199 However, it looks like one reference was missed. ARCHBOM-992 --- .../djangoapps/oauth_dispatch/adapters/dot.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/openedx/core/djangoapps/oauth_dispatch/adapters/dot.py b/openedx/core/djangoapps/oauth_dispatch/adapters/dot.py index 6912ecb439..384d6f9760 100644 --- a/openedx/core/djangoapps/oauth_dispatch/adapters/dot.py +++ b/openedx/core/djangoapps/oauth_dispatch/adapters/dot.py @@ -2,7 +2,6 @@ Adapter to isolate django-oauth-toolkit dependencies """ -from edx_django_utils.monitoring import set_custom_attribute from oauth2_provider import models from openedx.core.djangoapps.oauth_dispatch.models import RestrictedApplication @@ -101,7 +100,6 @@ class DOTAdapter: filter_set = set() if hasattr(application, 'access') and application.access.filters: filter_set.update(application.access.filters) - filter_set = self._add_org_relation_filters_to_set(application, filter_set) # Allow applications configured with the client credentials grant type to access # data for all users. This will enable these applications to fetch data in bulk. @@ -111,20 +109,3 @@ class DOTAdapter: filter_set.add(self.FILTER_USER_ME) return list(filter_set) - - def _add_org_relation_filters_to_set(self, application, filter_set): - """ - Adds Organization related filters to the filter_set. - - TODO: BOM-1292: Retire Application Organizations once all filters have been migrated - to Application Access. When retiring, this entire function can be deleted. - - """ - filter_set_before_orgs = filter_set.copy() - filter_set.update([org_relation.to_jwt_filter_claim() for org_relation in application.organizations.all()]) - - set_custom_attribute('filter_set_before_orgs', list(filter_set_before_orgs)) - set_custom_attribute('filter_set_after_orgs', list(filter_set)) - set_custom_attribute('filter_set_difference', list(filter_set.difference(filter_set_before_orgs))) - - return filter_set