Skip to content
Snippets Groups Projects
Commit bbf29b63 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Fix incompatibility between repo subdirs and preview mode

parent 69eab59c
No related branches found
No related tags found
No related merge requests found
......@@ -1252,6 +1252,9 @@ def get_course_commit_sha(course, participation):
preview_sha = participation.preview_git_commit_sha
repo = get_course_repo(course)
if isinstance(repo, SubdirRepoWrapper):
repo = repo.repo
try:
repo[preview_sha.encode()]
except KeyError:
......
......@@ -421,6 +421,11 @@ class CoursePageContext(object):
preview_sha = self.participation.preview_git_commit_sha.encode()
repo = get_course_repo(self.course)
from course.content import SubdirRepoWrapper
if isinstance(repo, SubdirRepoWrapper):
repo = repo.repo
try:
repo[preview_sha]
except KeyError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment