Skip to content

Commit 9a1e7e7

Browse files
fix: address quality errors
1 parent b7d8351 commit 9a1e7e7

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

openedx_authz/engine/utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,8 @@ def migrate_authz_to_legacy_course_roles(
312312
role_assignments = get_all_role_assignments_per_scope_type(scope_type=CourseOverviewData)
313313

314314
# Two cases here:
315-
# 1. If org_id is provided, we filter by org_id which will include both org-level glob scopes and course-level scopes linked to that org
316-
# 2. If only course_id_list is provided, we filter by course_id which will include only course-level scopes linked to those course_ids since
317-
# org-level glob scopes don't have course_id in their scope object
315+
# 1. org_id provided: filter by org — includes org-level glob and course-level scopes for that org.
316+
# 2. only course_id_list provided: filter by course_id — org-level glob scopes are excluded (no course_id).
318317
if org_id:
319318
role_assignments = [
320319
role_assignment
@@ -373,7 +372,7 @@ def migrate_authz_to_legacy_course_roles(
373372
if delete_after_migration:
374373
unassignments[(role_external_key, scope_external_key)].append(user_external_key)
375374

376-
except Exception as e:
375+
except Exception as e: # pylint: disable=broad-exception-caught
377376
logger.error(
378377
f"Error rolling back RoleAssignment for User: {role_assignment.subject.external_key} "
379378
f"in Role: {role_assignment.roles[0].external_key} and Scope: {role_assignment.scope.external_key}: {e}"

0 commit comments

Comments
 (0)