-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Adjusted token admin to map to user ID. #7341
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
Conversation
ce0ba1e
to
9cc352f
Compare
Closes encode#6131. * Adds a proxy model for Token that uses the user.pk, rather than it's own. * Adjusts Admin to map back from User ID to token instance.
9cc352f
to
27e9279
Compare
Righty, tested this all locally, both with a standard user model, and with a custom user model. |
Django complains about TokenProxy "TypeError: Abstract base class containing model fields not permitted for proxy model 'TokenProxy'.", Token is abstract model if the app is not installed |
@kalekseev "If the app is not installed" -- what does that mean exactly? (Is "install it" an appropriate fix?) Probably need a new issue with an example project. |
@carltongibson sorry for the lack of details I was from mobile. Basically Token become abstract if 'rest_framework.authtoken' not in settings.INSTALLED_APPS https://github.com/encode/django-rest-framework/blob/master/rest_framework/authtoken/models.py#L26. In my case |
So we could maybe fix this making Would you be up for adding a PR for that? |
@carlfarrington I have discovered that problem developing this pr #7438 and I don't have that much free time right now to commit myself to one more. |
Ok, in that case, can I ask you to open a new issue, so this doesn't get lost in the cracks? Thanks! |
Closes encode#6131. * Adds a proxy model for Token that uses the user.pk, rather than it's own. * Adjusts Admin to map back from User ID to token instance.
Closes #6131.
Proof of concept. Works but...
Thoughts?