Skip to content

Commit 02ca031

Browse files
committed
Fix development fetching
1 parent ac858f5 commit 02ca031

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/utils/gitmastery.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def _construct_gitmastery_exercises_url(filepath: str, version: Version) -> str:
4949
# If pinned, we need to basically search for all the available tags within the
5050
# range
5151
latest_within_pin = get_latest_exercise_version_within_pin(version)
52-
ref = f"tags/v{latest_within_pin}"
52+
if latest_within_pin is None:
53+
raise ValueError("This should not happen. Contact the Git-Mastery team.")
54+
ref = f"tags/v{latest_within_pin.to_version_string()}"
5355

5456
url = (
5557
f"https://raw.githubusercontent.com/git-mastery/exercises/refs/{ref}/{filepath}"
@@ -261,8 +263,12 @@ def hands_on_exists(hands_on: str, timeout: int = 5) -> bool:
261263
hands_on = hands_on[3:]
262264

263265
try:
266+
hands_on_url = get_gitmastery_file_path(
267+
f"hands_on/{hands_on.replace('-', '_')}.py"
268+
)
269+
print(hands_on_url)
264270
response = requests.head(
265-
get_gitmastery_file_path(f"hands_on/{hands_on.replace('-', '_')}.py"),
271+
hands_on_url,
266272
allow_redirects=True,
267273
timeout=timeout,
268274
)

0 commit comments

Comments
 (0)