Skip to content

Fix: Add permanent redirects for legacy sponsorship pages (Issue #2645)#2944

Open
iampujan wants to merge 5 commits intopython:mainfrom
iampujan:feature/issue-2645
Open

Fix: Add permanent redirects for legacy sponsorship pages (Issue #2645)#2944
iampujan wants to merge 5 commits intopython:mainfrom
iampujan:feature/issue-2645

Conversation

@iampujan
Copy link
Copy Markdown
Contributor

Fixes issue #2645 by permanently redirecting the broken /psf/sponsorship-old/ and /psf/forms/sponsor-application/ URLs to their modern counterparts.

Copilot AI review requested due to automatic review settings February 24, 2026 13:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes broken legacy sponsorship URLs by adding permanent HTTP 301 redirects to their modern counterparts. The issue (#2645) reported that users clicking on old sponsorship links encountered 404 errors, breaking the sponsorship application workflow.

Changes:

  • Added permanent redirects from /psf/sponsorship-old/ to /psf/sponsors/ and from /psf/forms/sponsor-application/ to /sponsors/application/
  • Added test coverage to verify both redirects return HTTP 301 status codes and redirect to the correct URLs

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pydotorg/urls.py Added two RedirectView entries for legacy sponsorship URLs with permanent=True flag
pydotorg/tests/test_views.py Added test_legacy_sponsor_redirects() method to verify both redirects work correctly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 9, 2026 16:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iampujan iampujan force-pushed the feature/issue-2645 branch from 2adb3f1 to 1e1ea39 Compare March 10, 2026 03:29
@iampujan iampujan force-pushed the feature/issue-2645 branch from 1e1ea39 to 2b3ff57 Compare March 10, 2026 03:32
Copilot AI review requested due to automatic review settings March 15, 2026 11:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 31, 2026 17:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# other section landing pages
path(
"psf/sponsorship-old/",
RedirectView.as_view(pattern_name="psf-sponsors", permanent=True),
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The legacy /psf/sponsorship-old/ URL is being redirected to the PSF sponsors list (psf-sponsors => /psf/sponsors/), but the site’s navigation and templates consistently treat /psf/sponsorship/ as the canonical sponsorship landing page (e.g., PSF index and sponsors list link to /psf/sponsorship/). Redirecting to /psf/sponsors/ is unlikely to be the intended “modern counterpart” and may not resolve the missing prospectus content from the old page. Consider redirecting /psf/sponsorship-old/ directly to /psf/sponsorship/ (using a fixed url= redirect since it’s not a named URLpattern).

Suggested change
RedirectView.as_view(pattern_name="psf-sponsors", permanent=True),
RedirectView.as_view(url="/psf/sponsorship/", permanent=True),

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +46
def test_legacy_sponsor_redirects(self):
"""Test that old sponsorship pages correctly redirect to modern active ones."""
response = self.client.get("/psf/sponsorship-old/")
self.assertRedirects(
response,
reverse("psf-sponsors"),
status_code=301,
fetch_redirect_response=False,
)
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The expected redirect target for /psf/sponsorship-old/ is asserted as reverse('psf-sponsors'). If the legacy redirect destination changes (e.g., to /psf/sponsorship/), this test needs to be updated to assert against the same canonical target to avoid locking in the wrong behavior.

Copilot uses AI. Check for mistakes.
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.

2 participants