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

Model documentation is confusing... #743

Open
monokrome opened this issue Oct 1, 2019 · 1 comment
Open

Model documentation is confusing... #743

monokrome opened this issue Oct 1, 2019 · 1 comment

Comments

@monokrome
Copy link

monokrome commented Oct 1, 2019

The documentation from 566fe67 is super confusing, because it refers to the setting as OAUTH2_PROVIDER_APPLICATION_MODEL but later refers to it as APPLICATION_MODEL.

Is this two settings? Is it one setting, and - if so - which name is it? I think that it's intended to be a single setting called APPLICATION_MODEL, but not 100% sure.

EDIT: It actually looks like you need to set both settings or else it won't work, even though they have the same values

@Wrufesh
Copy link

Wrufesh commented Oct 2, 2019

OAUTH2_PROVIDER_APPLICATION_MODEL field should be used in your django project setting file which is later assigned to APPLICATION_MODEL field of oauth2_provider settings module.

What you can do in swapped model is reference OAUTH2_PROVIDER_APPLICATION_MODEL from your django project settings.

from django.conf import settings
from django.db import models

class Grant(AbstractGrant):
    application = models.ForeignKey(settings.OAUTH2_PROVIDER_APPLICATION_MODEL, related_name='grants', on_delete=models.CASCADE)

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

No branches or pull requests

2 participants