Skip to content

Commit 2c77464

Browse files
committed
refactor: use new get_user_role_assignments_filtered api function
1 parent 2f1ac8a commit 2c77464

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

common/djangoapps/student/roles.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,10 @@ def _authz_get_orgs_for_user(self, user) -> list[str]:
533533
AuthZ compatibility layer
534534
"""
535535
role = get_authz_role_from_legacy_role(self._role_name)
536-
assignments = authz_api.get_user_role_assignments_for_role(user.username, role)
536+
assignments = authz_api.get_user_role_assignments_filtered(
537+
user_external_key=user.username,
538+
role_external_key=role,
539+
)
537540
orgs = {assignment.scope.org for assignment in assignments if assignment.scope.org is not None}
538541
return list(orgs)
539542

0 commit comments

Comments
 (0)