Skip to content

Voices redirect ref#3055

Open
akiva10b wants to merge 2 commits intomasterfrom
voices-redirect-ref
Open

Voices redirect ref#3055
akiva10b wants to merge 2 commits intomasterfrom
voices-redirect-ref

Conversation

@akiva10b
Copy link
Contributor

This pull request adds new tests and refactors the redirect logic for the "voices" module to ensure that requests for valid references are properly redirected to the "library" module, while invalid references return a 404 error. The most significant changes are the introduction of a dedicated redirect function and new tests to cover these cases.

Redirect logic improvements:

  • Added a new redirect_to_library function in reader/views.py to handle permanent redirects from the "voices" module to the "library" module, preserving query parameters and determining the correct target domain based on language.
  • Updated the catchall redirect logic in reader/views.py to use redirect_to_library for valid references, and to return a 404 error for invalid references instead of redirecting.

Testing enhancements:

  • Added test_voices_catchall_ref_redirects_to_library and test_voices_catchall_non_ref_404 in reader/tests/test_catchall_redirect.py to verify that valid references are redirected to the library module and invalid references return a 404 error, using test-specific domain settings.

@mergify
Copy link

mergify bot commented Jan 27, 2026

🧪 CI Insights

Here's what we observed from your CI run for d152654.

❌ Job Failures

Pipeline Job Health on master Retries 🔍 CI Insights 📄 Logs
Continuous Continuous Testing: PyTest Broken 0 View View

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.

1 participant