Issues sorting authtokens in django admin #8821
Unanswered
FeralRobot
asked this question in
Potential Issue
Replies: 1 comment
-
I think this answer shows that the issue you reported can not be reproduced #8830 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to be able to sort authtokens alphabetically by username in the django admin
I am using django 3.2.13, django restframework 3.13.1, and I am using a custom user model based on AbstractUser. The custom user model has no modifications at this moment.
This code, placed in the admin.py for the custom user app, allows me to get the alphabetic sort I want initially. There are two issues though. The first is that the search_fields line is required if I want the alphabetic sort. The second issue occurs when I click on the User column header (see green arrows). My expectation is clicking there would toggle back and forth between ascending and descending alphabetic order.
Instead the sort order changes to something that looks like user_id or created by order, and I lose the alphabetic order.
I can recover the alphabetic order by returning to the admin homepage and re-entering the tokens view.
These behaviors look like bugs to me, and I would like to report them as a Github issue in the DRF repo. That repo refers me here first for discussion
Beta Was this translation helpful? Give feedback.
All reactions