Skip to content

Commit aa3e463

Browse files
committed
chore: fix lint issues
1 parent 1295028 commit aa3e463

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

Diff for: openedx_learning/api/authoring.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from ..apps.authoring.collections.api import *
1313
from ..apps.authoring.components.api import *
1414
from ..apps.authoring.contents.api import *
15-
from ..apps.authoring.publishing.api import *
1615
from ..apps.authoring.linking.api import *
16+
from ..apps.authoring.publishing.api import *
1717

1818
# This was renamed after the authoring API refactoring pushed this and other
1919
# app APIs into the openedx_learning.api.authoring module. Here I'm aliasing to

Diff for: openedx_learning/api/authoring_models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
from ..apps.authoring.collections.models import *
1111
from ..apps.authoring.components.models import *
1212
from ..apps.authoring.contents.models import *
13+
from ..apps.authoring.linking.models import *
1314
from ..apps.authoring.publishing.model_mixins import *
1415
from ..apps.authoring.publishing.models import *
15-
from ..apps.authoring.linking.models import *

Diff for: openedx_learning/apps/authoring/linking/admin.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111

1212
@admin.register(PublishableEntityLink)
1313
class PublishableEntityLinkAdmin(ReadOnlyModelAdmin):
14-
fields = [
14+
"""
15+
PublishableEntityLink admin.
16+
"""
17+
fields = (
1518
"uuid",
1619
"upstream_block",
1720
"upstream_usage_key",
@@ -23,7 +26,7 @@ class PublishableEntityLinkAdmin(ReadOnlyModelAdmin):
2326
"version_declined",
2427
"created",
2528
"updated",
26-
]
29+
)
2730
readonly_fields = fields
2831
list_display = [
2932
"upstream_block",
@@ -44,6 +47,9 @@ class PublishableEntityLinkAdmin(ReadOnlyModelAdmin):
4447

4548
@admin.register(CourseLinksStatus)
4649
class CourseLinksStatusAdmin(admin.ModelAdmin):
50+
"""
51+
CourseLinksStatus admin.
52+
"""
4753
fields = (
4854
"context_key",
4955
"status",

Diff for: openedx_learning/apps/authoring/linking/models.py

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ class CourseLinksStatusChoices(models.TextChoices):
9898

9999

100100
class CourseLinksStatus(models.Model):
101+
"""
102+
This table stores current processing status of upstream-downstream links in PublishableEntityLink table for a
103+
course.
104+
"""
101105
context_key = key_field(
102106
help_text=_("Linking status for downstream/course context key"),
103107
)

Diff for: tests/openedx_learning/apps/authoring/linking/test_api.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44
from __future__ import annotations
55

66
from datetime import datetime, timezone
7-
from uuid import UUID
8-
9-
import pytest
10-
from django.core.exceptions import ValidationError
117

128
from openedx_learning.apps.authoring.components import api as components_api
9+
from openedx_learning.apps.authoring.components.models import Component, ComponentType
1310
from openedx_learning.apps.authoring.linking import api as linking_api
1411
from openedx_learning.apps.authoring.linking.models import CourseLinksStatus, PublishableEntityLink
1512
from openedx_learning.apps.authoring.publishing import api as publishing_api
1613
from openedx_learning.apps.authoring.publishing.models import LearningPackage
17-
from openedx_learning.apps.authoring.components.models import Component, ComponentType
1814
from openedx_learning.lib.test_utils import TestCase
1915

2016

@@ -71,16 +67,16 @@ def test_update_or_create_entity_link(self) -> None:
7167
"version_synced": 1,
7268
}
7369
# Should create new link
74-
link = linking_api.update_or_create_entity_link(self.html_component, **entity_args)
70+
link = linking_api.update_or_create_entity_link(self.html_component, **entity_args) # type: ignore[arg-type]
7571
assert PublishableEntityLink.objects.filter(downstream_usage_key=downstream_usage_key).exists()
7672
prev_updated_time = link.updated
7773
# Using the api with same arguments should not make any changes
78-
link = linking_api.update_or_create_entity_link(self.html_component, **entity_args)
74+
link = linking_api.update_or_create_entity_link(self.html_component, **entity_args) # type: ignore[arg-type]
7975
assert link.updated == prev_updated_time
8076
# update version_synced field
8177
link = linking_api.update_or_create_entity_link(
8278
self.html_component,
83-
**{**entity_args, "version_synced": 2}
79+
**{**entity_args, "version_synced": 2} # type: ignore[arg-type]
8480
)
8581
assert link.updated != prev_updated_time
8682
assert link.version_synced == 2
@@ -98,7 +94,7 @@ def test_delete_entity_link(self) -> None:
9894
"version_synced": 1,
9995
}
10096
# Should create new link
101-
linking_api.update_or_create_entity_link(self.html_component, **entity_args)
97+
linking_api.update_or_create_entity_link(self.html_component, **entity_args) # type: ignore[arg-type]
10298
assert PublishableEntityLink.objects.filter(downstream_usage_key=downstream_usage_key).exists()
10399
linking_api.delete_entity_link(downstream_usage_key)
104100
assert not PublishableEntityLink.objects.filter(downstream_usage_key=downstream_usage_key).exists()

0 commit comments

Comments
 (0)