mirror of
https://github.com/frappe/lms.git
synced 2026-04-26 18:49:26 +03:00
fix: asset export path
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
class="h-[120px] flex items-center justify-center bg-surface-gray-1 border border-dashed border-outline-gray-3 rounded-md"
|
||||
>
|
||||
<div
|
||||
class="w-fit bg-surface-white border rounded-md p-2 flex items-center justify-between items-center"
|
||||
class="w-fit bg-surface-white border rounded-md p-2 flex items-center justify-between items-center space-x-4"
|
||||
>
|
||||
<div class="space-y-2">
|
||||
<div class="font-medium leading-5 text-ink-gray-9">
|
||||
|
||||
@@ -244,15 +244,16 @@ def write_assessments_json(zip_file, assessments, questions, test_cases):
|
||||
|
||||
for assessment in assessments:
|
||||
assessment_json = frappe_json_dumps(assessment)
|
||||
safe_doctype = assessment["doctype"].lower()
|
||||
safe_name = sanitize_string(assessment["name"])
|
||||
zip_file.writestr(f"assessments/{safe_doctype}_{safe_name}.json", assessment_json)
|
||||
doctype = "_".join(assessment["doctype"].lower().split(" "))
|
||||
safe_name = "_".join(sanitize_string(assessment["name"]).split(" "))
|
||||
zip_file.writestr(f"assessments/{doctype}_{safe_name}.json", assessment_json)
|
||||
|
||||
|
||||
def write_assets(zip_file, assets):
|
||||
assets = list(set(assets))
|
||||
for asset in assets:
|
||||
if not asset or not isinstance(asset, str) or not is_safe_path(asset):
|
||||
real_path = frappe.get_site_path(asset.lstrip("/"))
|
||||
if not asset or not isinstance(asset, str) or not is_safe_path(real_path):
|
||||
continue
|
||||
|
||||
file_doc = frappe.get_doc("File", {"file_url": asset})
|
||||
|
||||
Reference in New Issue
Block a user