Fixes #851 - Missing pagination on locale index view#903
Open
Marvinrose wants to merge 4 commits intowagtail:mainfrom
Open
Fixes #851 - Missing pagination on locale index view#903Marvinrose wants to merge 4 commits intowagtail:mainfrom
Marvinrose wants to merge 4 commits intowagtail:mainfrom
Conversation
Contributor
Author
|
I also noticed the 10 CI failures are caused by a pre-existing bug where Wagtail renamed produced_error_message to get_error_message in a newer version. The fix is to add produced_error_message = None to both CreateView and EditView so they're compatible with the latest Wagtail. I've opened issue #904 and submitted a fix in PR #905. |
Collaborator
|
#905 is now merged. Can you rebase, and also add a test please? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #903 +/- ##
=======================================
Coverage 93.02% 93.03%
=======================================
Files 47 47
Lines 4245 4251 +6
Branches 551 552 +1
=======================================
+ Hits 3949 3955 +6
Misses 177 177
Partials 119 119 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Hi @zerolab Rebased and added pagination test as requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #851 - The Settings, Locales page was capped at 20 locales with no way to access the rest.
Why
IndexViewused a custom template (wagtaillocales/index.html) that overrode Wagtail's generic{% block listing %}with its own table loop. This bypassed Wagtail's built-in pagination entirely, meaning sites with 21+ locales could not access or manage the hidden ones.Fix
template_namefromIndexViewso it uses Wagtail's generic index template, which includes pagination automaticallytest_simpleto assert the generic template is used instead of the custom oneTesting
All
TestLocaleIndexViewtests pass: