Skip to content

Commit

Permalink
fix: pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Feb 15, 2024
1 parent aa93510 commit e94131f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def iterate_with_level(
def get_course_tagged_object_and_children(
course_key: CourseKey, object_tag_cache: ObjectTagByObjectIdDict
) -> tuple[TaggedContent, list[XBlock]]:
"""
Returns a TaggedContent with course metadata with its tags, and its children.
"""
store = modulestore()

course = store.get_course(course_key)
Expand All @@ -69,6 +72,9 @@ def get_course_tagged_object_and_children(
def get_library_tagged_object_and_children(
library_key: LibraryLocatorV2, object_tag_cache: ObjectTagByObjectIdDict
) -> tuple[TaggedContent, list[LibraryXBlockMetadata]]:
"""
Returns a TaggedContent with library metadata with its tags, and its children.
"""
library = library_api.get_library(library_key)
assert library is not None

Expand All @@ -90,6 +96,9 @@ def get_library_tagged_object_and_children(
def get_xblock_tagged_object_and_children(
usage_key: UsageKey, object_tag_cache: ObjectTagByObjectIdDict, store
) -> tuple[TaggedContent, list[XBlock]]:
"""
Returns a TaggedContent with xblock metadata with its tags, and its children.
"""
block = store.get_item(usage_key)
block_id = str(usage_key)
tagged_block = TaggedContent(
Expand All @@ -106,6 +115,10 @@ def get_xblock_tagged_object_and_children(
def get_library_block_tagged_object(
library_block: LibraryXBlockMetadata, object_tag_cache: ObjectTagByObjectIdDict
) -> tuple[TaggedContent, None]:
"""
Returns a TaggedContent with library content block metadata and its tags,
and 'None' as children.
"""
block_id = str(library_block.usage_key)
tagged_library_block = TaggedContent(
display_name=library_block.display_name,
Expand Down
3 changes: 1 addition & 2 deletions openedx/core/djangoapps/content_tagging/rest_api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
from typing import Iterator

from django.http import StreamingHttpResponse
from opaque_keys.edx.keys import CourseKey, UsageKey
from opaque_keys.edx.locator import LibraryLocatorV2
from opaque_keys.edx.keys import UsageKey
from openedx_tagging.core.tagging import rules as oel_tagging_rules
from openedx_tagging.core.tagging.rest_api.v1.views import ObjectTagView, TaxonomyView
from rest_framework import status
Expand Down

0 comments on commit e94131f

Please sign in to comment.