Skip to content

Commit 04f62e0

Browse files
refactor: address PR reviews
1 parent 8a8d271 commit 04f62e0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

openedx_authz/api/roles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def unassign_subject_from_all_roles(subject: SubjectData) -> bool:
556556
return enforcer.remove_filtered_grouping_policy(GroupingPolicyIndex.SUBJECT.value, subject.namespaced_key)
557557

558558

559-
def get_all_role_assignments_per_scope_type(scope_types: list[type[ScopeData]]) -> list[RoleAssignmentData]:
559+
def get_all_role_assignments_per_scope_type(scope_types: tuple[type[ScopeData], ...]) -> list[RoleAssignmentData]:
560560
"""Get all role assignments matching any of the given scope types.
561561
562562
Loads all grouping policies from the enforcer and filters in Python. Casbin policies
@@ -572,5 +572,5 @@ def get_all_role_assignments_per_scope_type(scope_types: list[type[ScopeData]])
572572
"""
573573
return [
574574
role_assignment for role_assignment in get_role_assignments()
575-
if isinstance(role_assignment.scope, tuple(scope_types))
575+
if isinstance(role_assignment.scope, scope_types)
576576
]

openedx_authz/engine/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def migrate_authz_to_legacy_course_roles(
322322
_validate_migration_input(course_id_list, org_id)
323323

324324
role_assignments = get_all_role_assignments_per_scope_type(
325-
scope_types=[CourseOverviewData, OrgCourseOverviewGlobData]
325+
scope_types=(CourseOverviewData, OrgCourseOverviewGlobData,)
326326
)
327327

328328
# Two cases here:

0 commit comments

Comments
 (0)