Changeset b514389 in flexograder
- Timestamp:
- 02/26/26 10:04:59 (5 weeks ago)
- Branches:
- fake-data, main
- Children:
- 65e7497
- Parents:
- e351d34
- File:
-
- 1 edited
-
flexograder/core_entities/exam.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flexograder/core_entities/exam.py
re351d34 rb514389 367 367 ) 368 368 369 # # Only referenced media, relative to media_root, stored under 'media/...'370 # for rel in self.referenced_media_paths():371 # # normalize to a relative Path372 # # strip any accidental leading slashes or 'media/' prefix373 # rel = Path(str(rel).lstrip("/\\"))374 # if str(rel).startswith("media/"):375 # rel = Path(str(rel)[6:]) # backward-compat if older JSON kept 'media/...'376 377 # abs_path = (media_root / rel).resolve()378 379 # # prevent path traversal: abs_path must stay within media_root380 # if media_root not in abs_path.parents and abs_path != media_root:381 # print(f"Skipping suspicious media path outside root: {abs_path}")382 # continue383 384 # if abs_path.exists():385 # arcname = Path("media") / rel # path inside the ZIP (relative)386 # # use POSIX path separators inside zip387 # zipf.write(abs_path, arcname=str(arcname.as_posix()))388 # else:389 # print(f"Missing media file: {abs_path}")390 391 # CSS inside zip at a fixed relative location392 369 if css.exists(): 393 370 zipf.write(css, arcname="static/exam.css") … … 431 408 "id": "personal_id", 432 409 "label": "Candidate ID", 433 "required": True 410 "required": True, 411 "pattern": r"^\d{8}$" 434 412 } 435 413 ],
Note:
See TracChangeset
for help on using the changeset viewer.
