-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort groups by name in group index view #11162
Conversation
Manage this branch in SquashTest this branch here: https://cnkissue-11159-9y2if.squash.io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
# This group should display after the default groups but will display | ||
# before them if default_ordering is lost. | ||
Group.objects.create(name="Photographers") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can move this to the test_default_ordering
test directly, as it's not needed for the others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although thinking about why this happened in the first place, I'm wondering whether we should've made it so that these attributes fall back to the view's attribute by default instead of having its own default in the ModelViewSet
(which is set to None
).
This applies to other attributes e.g. list_per_page
though, so I'm happy to accept this fix for now.
9f0906f
to
6fefdf0
Compare
I think this happens for Locale and Site too, so maybe I should rethink. Will get back to this in an hour! |
It seems we lucked out...
With how close the release is, I'm inclined to leave them out of this PR. Will see if we can better handle this in 6.0. |
Thanks @cnk and @laymonage! For 6.0 I think we should change the behaviour of |
Fixes #11159
git bisect
tells me that the sort on the group index view broke at commit 27aabc1 I would have thought that the new code would use thedefault_ordering
in the IndexView but it clearly does not. Removing it and moving the ordering to the ViewSet restores ordering by name as the default sort order.Please check the following:
make lint
from the Wagtail root.Please describe additional details for testing this change.
Footnotes
Development Testing ↩