Skip to content

Added requirement for UserAdmin.search_fields to 3.10 release notes. #6811

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

Closed

Conversation

carltongibson
Copy link
Collaborator

Closes #6808.


**Note**: If you're using a custom user model, ensure your user admin
declared the `search_fields` property, in order to work with `TokenAdmin`
autocomplete fields.
Copy link
Member

Choose a reason for hiding this comment

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

Would it be helpful to mention the (admin.E040) so the error code is searchable?

Copy link
Member

Choose a reason for hiding this comment

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

@rpkilby
Copy link
Member

rpkilby commented Jul 17, 2019

I think the documentation approach makes sense, as this should only affect projects that define a custom user model/admin that doesn't set search_fields. If a project uses the builtin user model/admin or inherits those, they should be fine.

@rpkilby
Copy link
Member

rpkilby commented Jul 17, 2019

Of course, the other option is to just revert #6762 and let users modify the admin when there is a sufficiently large number of users in their database.

@tomchristie
Copy link
Member

tomchristie commented Jul 17, 2019

I think we should probably prefer #6817 - given that Django docs heavily nudge folks towards custom user models it's likely that the change in behavior would affect a significant number of upgrades, and I don't think it's a clear enough improvement for us to do that.

Let's help folks in the right direction for customizing the TokenAuth admin themselves instead.

@tomchristie tomchristie mentioned this pull request Jul 17, 2019
@carltongibson
Copy link
Collaborator Author

OK, if you prefer. Seems a bit of a shame but...

@tomchristie
Copy link
Member

I'm not super wild about either option TBH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rest_framework 3.10.0 - crash with runserver
3 participants