Skip to content

Commit

Permalink
temp: suffix with upstream info, for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmccormick committed Jul 26, 2024
1 parent 713c20f commit 5353d2c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions xmodule/capa_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,22 @@ def display_name_with_default(self):
Default to the display_name if it isn't None or not an empty string,
else fall back to problem category.
"""
# @@TODO: temporary suffix code
from openedx.core.djangoapps.content_libraries.sync import BadUpstream
try:
upstream_meta = self.get_upstream_meta()
except BadUpstream:
suffix = ""
else:
latest = upstream_meta.version_num
suffix = f" [v{self.upstream_version}]"
if self.upstream_version < latest:
suffix += f" [UPDATE AVAILBLE: v{latest}]"

if self.display_name is None or not self.display_name.strip():
return self.location.block_type
return self.location.block_type + suffix

return self.display_name
return self.display_name + suffix

def grading_method_display_name(self) -> str | None:
"""
Expand Down

0 comments on commit 5353d2c

Please sign in to comment.