Six ops list and detail pages dereferenced a nullable user to print their name,
which renders an empty cell when the field is unset. Guard each one so the cell
reads "-" instead.
Screens: batch detail, CoA review detail, document list, EUDR detail, and the two
QC verification pages.
Guide visibility is now scoped by PORTAL first and role second:
- the buyer portal lists shared and buyer guides, even for an admin, because it
is the buyer portal; admin guides never surface there
- the ops portal lists shared and ops guides, plus admin guides for an
admin/superuser
- the detail view names its context object, so guide pages get a real browser
title instead of a blank one
Link rewriting, so one page can serve both the wiki and the in-app help centre:
- absolute /en/user-guides/... links become the in-app help path
- other absolute /en/... links point at the wiki itself; the app hosts serve no
/en/ routes, so leaving them untouched was a 404 for whoever clicked
- relative links keep their existing behaviour
Tests cover the new rewriting and the portal scoping rules. Also adds
docs/USER_GUIDES_VIEWER_SPEC.md, the spec this viewer was built to.
- settings: trust nginx X-Forwarded-Proto, mark session and CSRF cookies secure,
and set the CSRF trusted origins for the ixgltd.com hosts
- docker-compose: bind the app port to 127.0.0.1 only; nginx fronts it, so there
is no reason for 0.0.0.0
- entrypoint: when the container is given a command, run that instead of always
starting gunicorn (needed for manage.py shell and the test suite)
- gitignore: keep Celery runtime state and stray local backups out of the tree
No functional change to the application itself.
- New apps/guides app with GuidePage model and audience mapping by wiki path
- sync_guides management command: one-way read-only sync from wikijs DB
- Read-only wikijs_ro DB role + WIKI_DB_* env config (secrets, gitignored)
- Markdown rendering with bleach sanitisation; rewrites internal guide links
to the portal help root and wiki image paths to WIKI_PUBLIC_BASE
- /portal/help/ (buyer) and /ops/help/ (ops) index + detail views with
role-based audience filtering (404 on cross-role guides)
- Help nav item added to both portal base templates
- Tests: audience filtering, markdown sanitisation, link rewriting, sync command