Changeset b514389 in flexograder


Ignore:
Timestamp:
02/26/26 10:04:59 (5 weeks ago)
Author:
Enrico Schwass <ennoausberlin@…>
Branches:
fake-data, main
Children:
65e7497
Parents:
e351d34
Message:

add pending change to fix candidate id check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • flexograder/core_entities/exam.py

    re351d34 rb514389  
    367367                )
    368368
    369             # # Only referenced media, relative to media_root, stored under 'media/...'
    370             # for rel in self.referenced_media_paths():
    371             #     # normalize to a relative Path
    372             #     # strip any accidental leading slashes or 'media/' prefix
    373             #     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_root
    380             #     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             #         continue
    383 
    384             #     if abs_path.exists():
    385             #         arcname = Path("media") / rel  # path inside the ZIP (relative)
    386             #         # use POSIX path separators inside zip
    387             #         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 location
    392369            if css.exists():
    393370                zipf.write(css, arcname="static/exam.css")
     
    431408                    "id": "personal_id",
    432409                    "label": "Candidate ID",
    433                     "required": True
     410                    "required": True,
     411                    "pattern": r"^\d{8}$"
    434412                }
    435413            ],
Note: See TracChangeset for help on using the changeset viewer.