Skip to content

Commit

Permalink
fix: [AXM-791] remove unsed import and generic Exception from retry
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Jun 21, 2024
1 parent 2049fab commit 378e594
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions openedx/features/offline_mode/storage_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from openedx.core.storage import get_storage
from zipfile import ZipFile

from .assets_management import block_storage_path, clean_outdated_xblock_files, is_modified
from .assets_management import block_storage_path, clean_outdated_xblock_files
from .html_manipulator import HtmlManipulator
from .renderer import XBlockRenderer

Expand Down Expand Up @@ -48,20 +48,17 @@ def render_block_html_data(self):
"""
try:
return XBlockRenderer(str(self.xblock.location)).render_xblock_from_lms()
except Http404:
except Http404 as e:
log.error(
f'Block {str(self.xblock.location)} cannot be fetched from course'
f' {self.xblock.location.course_key} during offline content generation.'
)
return None
raise e

def generate_offline_content(self):
"""
Generates archive with XBlock content for offline mode.
"""
if not self.html_data:
return

base_path = block_storage_path(self.xblock)
clean_outdated_xblock_files(self.xblock)
tmp_dir = mkdtemp()
Expand Down

0 comments on commit 378e594

Please sign in to comment.