Skip to content

Commit

Permalink
style: Nits on the code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChV committed Oct 19, 2024
1 parent 87be898 commit b6138eb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions openedx/core/djangoapps/content/search/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ def _get_description_from_block_content(block_type, block_content) -> str:
Generate description from block content
"""
result = None

if block_type == 'html' and 'html_content' in block_content:
result = block_content['html_content']
elif block_type == 'problem' and 'capa_content' in block_content:
result = block_content['capa_content']

return result


Expand Down Expand Up @@ -210,7 +210,7 @@ class implementation returns only:
parent_data,
)
try:
content_data = _get_content_from_block(block)
content_data = _get_content_from_block(block)
block_data[Fields.content] = content_data

# Generate description from the content
Expand Down Expand Up @@ -371,7 +371,7 @@ def searchable_doc_for_library_block(xblock_metadata: lib_api.LibraryXBlockMetad
"""
library_name = lib_api.get_library(xblock_metadata.usage_key.context_key).title
block = xblock_api.load_block(xblock_metadata.usage_key, user=None)

try:
block_published = xblock_api.load_block(xblock_metadata.usage_key, user=None, version=LatestVersion.PUBLISHED)
except NotFound:
Expand All @@ -388,7 +388,7 @@ def searchable_doc_for_library_block(xblock_metadata: lib_api.LibraryXBlockMetad
})

doc.update(_fields_from_block(block))

if block_published:
doc.update(_published_data_from_block(block_published))

Expand Down

0 comments on commit b6138eb

Please sign in to comment.