Skip to content

Use request host for exhibit URLs instead of hardcoded jandig.app (#822)#941

Open
vjpixel wants to merge 1 commit into
developfrom
claude/fix-822-dev-exhibit-links
Open

Use request host for exhibit URLs instead of hardcoded jandig.app (#822)#941
vjpixel wants to merge 1 commit into
developfrom
claude/fix-822-dev-exhibit-links

Conversation

@vjpixel

@vjpixel vjpixel commented Apr 25, 2026

Copy link
Copy Markdown
Member

Summary

Exhibit detail and create-exhibit pages were rendering URL previews and "share" links with a hardcoded https://jandig.app/. On dev, an exhibit at dev.jandig.app/exhibit/?id=N showed a share URL pointing at https://jandig.app/<slug>/, sending users away from the dev environment they were testing on.

Switch user-facing references to {{ request.scheme }}://{{ request.get_host() }}/ so each environment links to itself. The "See this exhibition" anchor in exhibit_detail.jinja2 uses a relative /{slug} path, which avoids the question entirely.

Files changed

  • src/core/jinja2/core/exhibit_detail.jinja2:
    • Display URL → {{ request.scheme }}://{{ request.get_host() }}/<slug>
    • Anchor href → /{slug} (relative)
  • src/core/jinja2/core/exhibit_create_ar.jinja2 / exhibit_create_mr.jinja2:
    • URL-helper preview label → dynamic host

Test plan

  • On dev.jandig.app/exhibit/?id=…: share link reads dev.jandig.app/<slug> and clicking goes to dev.jandig.app/<slug> (not production).
  • On jandig.app/exhibit/?id=…: share link reads jandig.app/<slug> (unchanged behaviour).
  • Create-exhibit "Your exhibit URL will look like this" preview uses the current host.

Closes #822

https://claude.ai/code/session_01XC1THLWgnGXGf5wgRhdyvB


Generated by Claude Code

Exhibit detail and create-exhibit pages were rendering links and
URL previews with a hardcoded https://jandig.app/. On dev, an
exhibit at dev.jandig.app/exhibit/?id=N showed a "share" link
pointing at https://jandig.app/<slug>/, sending users away from
the dev environment they were testing on.

Switch the user-facing references to {{ request.scheme }}://{{ request.get_host() }}/
so dev.jandig.app and jandig.app each link to themselves. The
"See this exhibition" anchor in exhibit_detail uses a relative
/{slug} path, which avoids the question entirely.

Files:
- exhibit_detail.jinja2: dynamic display URL + relative href.
- exhibit_create_ar.jinja2 / exhibit_create_mr.jinja2: dynamic
  url-helper preview label.

Closes #822

https://claude.ai/code/session_01XC1THLWgnGXGf5wgRhdyvB
<p class="gallery-title">{{ _("Your exhibit URL will look like this") }}</p>
<div style="display: flex; width: 100%">
<label class="url-helper">https://jandig.app/</label>
<label class="url-helper">{{ request.scheme }}://{{ request.get_host() }}/</label>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably can use request.host here, but not request.scheme. I've not confirmed it, but SSL termination happens on our elastic load balancer on Amazon, using request.scheme here is probably going to return "http:" and http links are always redirected to https, so this will make all users be redirected once on each link.

We should keep https:// hardcoded to avoid any issues with internal network schemes, and use only the host part to get "dev.jandig.app" or "jandig.app" here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong link for exhibits on dev

3 participants