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

Registration custom class for in django admin #898

Open
folt opened this issue Nov 18, 2020 · 0 comments
Open

Registration custom class for in django admin #898

folt opened this issue Nov 18, 2020 · 0 comments

Comments

@folt
Copy link
Contributor

folt commented Nov 18, 2020

I am getting an issue with admin page extension. When I do
admin.site.register (AccessToken, AccessTokenAdmin)
where AccessTokenAdmin is my class, then I get the error "The model AccessToken is already registered".

I propose a solution when you can specify a class file for the django administration panel:
ACCESS_TOKEN_ADMIN = getattr (settings, "OAUTH2_PROVIDER_ACCESS_TOKEN_ADMIN", "custom.AccessToken")

Currently, we have to solve this problem as follows:

if not admin.site.is_registered (AccessToken):
     admin.site.register (AccessToken, AccessTokenAdmin)

I'm willing to contribute if the community supports it.

folt added a commit to folt/django-oauth-toolkit that referenced this issue Dec 11, 2020
folt added a commit to folt/django-oauth-toolkit that referenced this issue Dec 11, 2020
folt added a commit to folt/django-oauth-toolkit that referenced this issue Dec 11, 2020
folt added a commit to folt/django-oauth-toolkit that referenced this issue Dec 11, 2020
folt added a commit to folt/django-oauth-toolkit that referenced this issue Dec 11, 2020
folt added a commit to folt/django-oauth-toolkit that referenced this issue Dec 14, 2020
folt added a commit to folt/django-oauth-toolkit that referenced this issue Dec 14, 2020
folt added a commit to folt/django-oauth-toolkit that referenced this issue Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant