Skip to content

Add public profile pages and link usernames to them (#255) - #985

Open
vjpixel wants to merge 1 commit into
developfrom
feature/255-profile-links
Open

vjpixel wants to merge 1 commit into
developfrom
feature/255-profile-links

Conversation

@vjpixel

@vjpixel vjpixel commented Sep 17, 2026

Copy link
Copy Markdown
Member

Description

Profiles existed but only their owner could reach one, so a curator looking at an artwork had no way to learn anything about the person who made it — which is the gap the issue describes.

This adds users/<username>/. It reuses the existing profile page rather than building a second one: the edit and delete controls were hardcoded as editable=true, deletable=true, and are now editable=is_owner, deletable=is_owner, so a visitor sees the same content with no actions they could not perform. The owner visiting their own public URL still gets the controls.

Usernames now link there from the marker, object, sound and artwork modals, and from exhibit cards.

Resolves (Issues)

Closes #255

General tasks performed

  • Extracted _profile_context() and _profile_queryset() from profile(), and added public_profile() using get_object_or_404.
  • Registered path("<str:username>/", ...) last in users/urls.py, with a comment saying why — it matches any single segment, so every literal route has to resolve before it.
  • Linked usernames in five templates.
  • Added src/users/tests/test_public_profile.py — 8 tests.

One deliberate omission

The issue asks for e-mail addresses on the page, and I did not add them. Publishing a user's e-mail on a page anyone can fetch by guessing a username is a scraping target and a privacy problem the users never opted into. If the goal is "a curator can reach the author", the right shape is a contact form that relays the message, or a per-user opt-in — both worth their own issue. test_the_page_does_not_expose_the_email_address locks the current behaviour so this cannot regress by accident.

Two things worth flagging

A username can be empty in existing data. My first version rendered the link unconditionally and 500'd on a marker whose owner had an empty username — NoReverseMatch — which the existing test_api_markers modal tests caught. The link is now conditional, and test_marker_modal_renders_when_the_owner_has_no_username covers it. Removing the guard makes that test fail, so it does exercise the path. It may be worth a separate look at why users with empty usernames exist.

A user literally named profile would be shadowed by the existing profile/ route. Left as-is rather than adding a reserved-name check, but say the word and I will.

Verification: full suite pytest src/core src/users src/blog passes — 279 passed.

Have you confirmed the application builds locally without error? See here.

  • Yes

🤖 Generated with Claude Code

https://claude.ai/code/session_01HXUw7kyELDu8ycGQxtaFbb


Generated by Claude Code

Profile data existed but was only reachable by its owner, so a curator
seeing an artwork had no way to find out anything about the person who
made it.

Adds users/<username>/, reusing the existing profile page with the edit and
delete controls gated behind is_owner, and turns the usernames in the marker,
object, sound and artwork modals and on exhibit cards into links to it.

Email addresses are deliberately not shown; see the PR for the reasoning.

Closes #255

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXUw7kyELDu8ycGQxtaFbb

This branch has not been deployed

No deployments
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.

show user's profiles

2 participants