Skip to content

Commit 0e7a10a

Browse files
refactor: address quality issues after rebase
1 parent 75335f5 commit 0e7a10a

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

openedx_authz/api/roles.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ def get_scopes_for_subject_and_permission(
419419
if permission in role.permissions and role_assignment.scope not in scopes:
420420
scopes.append(role_assignment.scope)
421421
return scopes
422-
return [SubjectData(namespaced_key=policy[GroupingPolicyIndex.SUBJECT.value]) for policy in policies]
423422

424423

425424
def unassign_subject_from_all_roles(subject: SubjectData) -> bool:

openedx_authz/handlers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ def delete_casbin_rule_on_extended_rule_deletion(sender, instance, **kwargs): #
5656
)
5757

5858

59-
def unassign_roles_on_user_retirement(sender, user, **kwargs):
60-
"""Unassign roles from a user when they are retired.
59+
def unassign_roles_on_user_retirement(sender, user, **kwargs): # pylint: disable=unused-argument
60+
"""
61+
Unassign roles from a user when they are retired.
6162
6263
This handler is triggered when a user is retired in the LMS. It ensures that
6364
any roles assigned to the user are removed, maintaining the integrity of the
@@ -70,7 +71,7 @@ def unassign_roles_on_user_retirement(sender, user, **kwargs):
7071
"""
7172
try:
7273
unassign_all_roles_from_user(user.username)
73-
except Exception as exc:
74+
except Exception as exc: # pylint: disable=broad-exception-caught
7475
logger.exception(
7576
"Error unassigning roles from user %s during retirement",
7677
user.id,

openedx_authz/tests/api/test_roles.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,6 @@ def test_unassign_and_reassign_subject(self):
11051105
- Newly assigned roles work correctly
11061106
"""
11071107
subject = SubjectData(external_key="bob")
1108-
original_scope = ScopeData(external_key="lib:Org1:history_201")
11091108
new_scope = ScopeData(external_key="lib:Org1:new_library")
11101109
new_role = RoleData(external_key="library_admin")
11111110

openedx_authz/tests/integration/test_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from django.contrib.auth import get_user_model
1111
from django.test import TestCase
12-
from openedx.core.djangoapps.user_api.accounts.signals import USER_RETIRE_LMS_CRITICAL
12+
from openedx.core.djangoapps.user_api.accounts.signals import USER_RETIRE_LMS_CRITICAL # pylint: disable=import-error
1313

1414
from openedx_authz.api.data import UserData
1515
from openedx_authz.api.users import (

0 commit comments

Comments
 (0)