Skip to content

Commit 37c09f3

Browse files
refactor: address quality issues
1 parent a46866a commit 37c09f3

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

openedx_authz/api/roles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def assign_role_to_subject_in_scope(subject: SubjectData, role: RoleData, scope:
242242
subject=subject.namespaced_key,
243243
role=role.namespaced_key,
244244
scope=scope.namespaced_key,
245-
actor=getattr(get_current_user(), "username", None)
245+
actor=getattr(get_current_user(), "username", None),
246246
)
247247
)
248248
)
@@ -293,7 +293,7 @@ def unassign_role_from_subject_in_scope(subject: SubjectData, role: RoleData, sc
293293
subject=subject.namespaced_key,
294294
role=role.namespaced_key,
295295
scope=scope.namespaced_key,
296-
actor=getattr(get_current_user(), "username", None)
296+
actor=getattr(get_current_user(), "username", None),
297297
)
298298
)
299299
)

openedx_authz/engine/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,10 @@ def migrate_authz_to_legacy_course_roles(
405405
_validate_migration_input(course_id_list, org_id)
406406

407407
role_assignments = get_all_role_assignments_per_scope_type(
408-
scope_types=(CourseOverviewData, OrgCourseOverviewGlobData)
408+
scope_types=(
409+
CourseOverviewData,
410+
OrgCourseOverviewGlobData,
411+
)
409412
)
410413

411414
# Two cases here:

openedx_authz/migrations/0008_roleassignmentaudit.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
98
("openedx_authz", "0007_coursescope"),
109
]
@@ -47,8 +46,7 @@ class Migration(migrations.Migration):
4746
"scope",
4847
models.CharField(
4948
help_text=(
50-
"Namespaced key of the scope"
51-
" (e.g. 'course-v1^course-v1:org+course+run') or glob pattern."
49+
"Namespaced key of the scope (e.g. 'course-v1^course-v1:org+course+run') or glob pattern."
5250
),
5351
max_length=255,
5452
),
@@ -58,8 +56,7 @@ class Migration(migrations.Migration):
5856
models.CharField(
5957
blank=True,
6058
help_text=(
61-
"Username of the user who performed the operation,"
62-
" or None for system-initiated actions."
59+
"Username of the user who performed the operation, or None for system-initiated actions."
6360
),
6461
max_length=150,
6562
null=True,

openedx_authz/models/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from openedx_authz.constants import AUTHZ_POLICY_ATTRIBUTES_SEPARATOR
1313
from openedx_authz.engine.filter import Filter
1414

15+
1516
class BaseRegistryModel(models.Model):
1617
"""Base model that supports automatic subclass registration.
1718

0 commit comments

Comments
 (0)