Skip to content

Commit fdd85e0

Browse files
refactor: address quality issues
1 parent 5f46d56 commit fdd85e0

5 files changed

Lines changed: 10 additions & 7 deletions

File tree

openedx_authz/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ class ScopeTypeFilter(admin.SimpleListFilter):
9898
parameter_name = "scope_type"
9999

100100
def lookups(self, request, model_admin):
101-
"""Return the available scope type choices.
101+
"""
102+
Return the available scope type choices.
102103
103104
Audit records are independent from live Casbin tables and scope objects:
104105
there are no FK references to filter on. The namespace prefix in the

openedx_authz/api/roles.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
from crum import get_current_user
1414
from django.db import transaction
15-
1615
from openedx_events.authz.data import RoleAssignmentData as RoleAssignmentEventData
1716
from openedx_events.authz.signals import ROLE_ASSIGNMENT_CREATED, ROLE_ASSIGNMENT_DELETED
1817

openedx_authz/migrations/0008_roleassignmentaudit.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,21 @@ class Migration(migrations.Migration):
4646
(
4747
"scope",
4848
models.CharField(
49-
help_text="Namespaced key of the scope (e.g. 'course-v1^course-v1:org+course+run') or glob pattern.",
49+
help_text=(
50+
"Namespaced key of the scope"
51+
" (e.g. 'course-v1^course-v1:org+course+run') or glob pattern."
52+
),
5053
max_length=255,
5154
),
5255
),
5356
(
5457
"actor",
5558
models.CharField(
5659
blank=True,
57-
help_text="Username of the user who performed the operation, or None for system-initiated actions.",
60+
help_text=(
61+
"Username of the user who performed the operation,"
62+
" or None for system-initiated actions."
63+
),
5864
max_length=150,
5965
null=True,
6066
),

openedx_authz/models/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from openedx_authz.constants import AUTHZ_POLICY_ATTRIBUTES_SEPARATOR
1414
from openedx_authz.engine.filter import Filter
1515

16-
1716
User = get_user_model()
1817

1918
class BaseRegistryModel(models.Model):

openedx_authz/tests/api/test_roles.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from ddt import ddt, unpack
1414
from django.test import TestCase
1515

16-
1716
from openedx_authz.api.data import (
1817
ActionData,
1918
ContentLibraryData,
@@ -54,7 +53,6 @@
5453
from openedx_authz.models import ExtendedCasbinRule, Scope, Subject
5554

5655

57-
5856
def _mock_get_or_create_scope(scope_data):
5957
"""Mock implementation that creates actual Scope instances."""
6058
scope, _ = Scope.objects.get_or_create(id=hash(scope_data.external_key) % 10000)

0 commit comments

Comments
 (0)