Skip to content

Commit 20369d6

Browse files
committed
temp: suffix with upstream info, for testing
1 parent 0eac501 commit 20369d6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

xmodule/capa_block.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,22 @@ def display_name_with_default(self):
486486
Default to the display_name if it isn't None or not an empty string,
487487
else fall back to problem category.
488488
"""
489+
# @@TODO: temporary suffix code
490+
from openedx.core.djangoapps.content_libraries.sync import BadUpstream
491+
try:
492+
upstream_meta = self.get_upstream_meta()
493+
except BadUpstream:
494+
suffix = ""
495+
else:
496+
latest = upstream_meta.version_num
497+
suffix = f" [v{self.upstream_version}]"
498+
if self.upstream_version < latest:
499+
suffix += f" [UPDATE AVAILBLE: v{latest}]"
500+
489501
if self.display_name is None or not self.display_name.strip():
490-
return self.location.block_type
502+
return self.location.block_type + suffix
491503

492-
return self.display_name
504+
return self.display_name + suffix
493505

494506
def grading_method_display_name(self) -> str | None:
495507
"""

0 commit comments

Comments
 (0)