pythondotorg
pythondotorg copied to clipboard
Fix PSF membership link (#2787) with dynamic logic
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.htmlto 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.