Skip to content

Commit

Permalink
fix: type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Oct 22, 2024
1 parent e9a6f40 commit 0eb0f01
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cms/lib/xblock/upstream_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ def ready_to_sync(self) -> bool:
)

@property
def upstream_link(self) -> str:
def upstream_link(self) -> str | None:
"""
Link to edit/view upstream block in library.
"""
if self.version_available is None:
if self.version_available is None or self.upstream_ref is None:
return None
try:
usage_key = LibraryUsageLocatorV2.from_string(self.upstream_ref)
Expand Down Expand Up @@ -369,8 +369,7 @@ def _get_library_xblock_url(usage_key: LibraryUsageLocatorV2):
Gets authoring url for given library_key.
"""
library_url = None
mfe_base_url = settings.COURSE_AUTHORING_MICROFRONTEND_URL
if mfe_base_url:
if mfe_base_url := settings.COURSE_AUTHORING_MICROFRONTEND_URL: # type: ignore
library_key = usage_key.lib_key
library_url = f'{mfe_base_url}/library/{library_key}/components?usageKey={usage_key}'
return library_url
Expand Down

0 comments on commit 0eb0f01

Please sign in to comment.