Merge pull request #1171 from pateljannat/scorm-check-if-file

fix: check if its file before fetching
This commit is contained in:
Jannat Patel
2024-12-06 16:13:09 +05:30
committed by GitHub

View File

@@ -154,6 +154,8 @@ class SCORMRenderer(BaseRenderer):
if not extension: if not extension:
path = f"{path}.html" path = f"{path}.html"
# check if path exists and is actually a file and not a folder
if os.path.exists(path) and os.path.isfile(path):
f = open(path, "rb") f = open(path, "rb")
response = Response( response = Response(
wrap_file(frappe.local.request.environ, f), direct_passthrough=True wrap_file(frappe.local.request.environ, f), direct_passthrough=True