pythondotorg icon indicating copy to clipboard operation
pythondotorg copied to clipboard

Fix PSF membership link (#2787) with dynamic logic

Open czc0407 opened this issue 2 months ago • 0 comments

Summary

Fixes #2766 — Clicking the PSF membership link previously led to /users/membership/edit/, causing a 404 for unauthenticated users. This PR updates the link rendering logic and adds tests.

Changes

  • Updated templates/includes/authenticated.html to dynamically choose:
    • /users/membership/ for non-members
    • /users/membership/edit/ for existing members
  • Added new test file: users/tests/test_membership_links.py

Testing

Run:

python3 manage.py test users.tests.test_membership_links

All tests passed ✅

Impact

This fix ensures the membership link works for both logged-in and anonymous users.

czc0407 avatar Oct 23 '25 10:10 czc0407