Skip to content

Commit

Permalink
fix: do not use the runtime.replace_urls when the runtime is not ready
Browse files Browse the repository at this point in the history
This happens while generating the Block Structures.
  • Loading branch information
Agrendalath committed May 30, 2023
1 parent bd05d59 commit 530248d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion problem_builder/__init__.py
@@ -1 +1 @@
__version__ = "5.1.2"
__version__ = "5.1.3"
4 changes: 2 additions & 2 deletions problem_builder/mixins.py
Expand Up @@ -295,8 +295,8 @@ def expand_static_url(self, text):
if not text:
return text

if hasattr(self.runtime, 'replace_urls'):
text = self.runtime.replace_urls(text)
if replace_urls := getattr(self.runtime, 'replace_urls', None):
text = replace_urls(text)
elif hasattr(self.runtime, 'course_id'):
# edX Studio uses a different runtime for 'studio_view' than 'student_view',
# and the 'studio_view' runtime doesn't provide the replace_urls API.
Expand Down

0 comments on commit 530248d

Please sign in to comment.