Skip to content

Commit 530248d

Browse files
committed
fix: do not use the runtime.replace_urls when the runtime is not ready
This happens while generating the Block Structures.
1 parent bd05d59 commit 530248d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

problem_builder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "5.1.2"
1+
__version__ = "5.1.3"

problem_builder/mixins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ def expand_static_url(self, text):
295295
if not text:
296296
return text
297297

298-
if hasattr(self.runtime, 'replace_urls'):
299-
text = self.runtime.replace_urls(text)
298+
if replace_urls := getattr(self.runtime, 'replace_urls', None):
299+
text = replace_urls(text)
300300
elif hasattr(self.runtime, 'course_id'):
301301
# edX Studio uses a different runtime for 'studio_view' than 'student_view',
302302
# and the 'studio_view' runtime doesn't provide the replace_urls API.

0 commit comments

Comments
 (0)