Skip to content
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

TokenAdmin.autocomplete_fields Breaks Some Use Cases, Revert #9301

Merged
merged 1 commit into from Mar 21, 2024

Conversation

alexdlaird
Copy link
Contributor

@alexdlaird alexdlaird commented Mar 18, 2024

Description

Fixes #9300. From the discussion in that issue, the PR (here) that added TokenAdmin.autocomplete_fields does not work in all cases and should be reverted.

For individuals that want this same functionality after it is reverted, they can do the follow to patch TokenAdmin:

from rest_framework.authtoken.admin import TokenAdmin

TokenAdmin.autocomplete_fields = ("user",)

Happy to add the above to the docs too, if folks think that's worthwhile, otherwise wanted it to be in this PR so those searching for the issue find the above solution.

@auvipy auvipy requested a review from tomchristie March 18, 2024 15:07
Copy link
Contributor

@browniebroke browniebroke left a comment

Choose a reason for hiding this comment

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

Although this autocomple option was one of the changes I was waiting 3.15 for, I think reverting is the right thing to do.

Not a maintainer, but in case it helps, LGTM

@tomchristie tomchristie merged commit d7c8dcf into encode:master Mar 21, 2024
9 checks passed
@tomchristie tomchristie mentioned this pull request Mar 21, 2024
9 tasks
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.

Error: An admin for model "User" has to be registered to be referenced by TokenAdmin.autocomplete_fields.
3 participants