admin: add provider admin

This commit is contained in:
Jens Langhammer
2018-11-26 22:40:10 +01:00
parent 755997a9c7
commit c0c51981ba
8 changed files with 162 additions and 1 deletions

View File

@ -0,0 +1,15 @@
"""passbook OAuth2 IDP Forms"""
from django import forms
from passbook.oauth_provider.models import OAuth2Provider
class OAuth2ProviderForm(forms.ModelForm):
"""OAuth2 Provider form"""
class Meta:
model = OAuth2Provider
fields = ['name', 'user', 'redirect_uris', 'client_type',
'authorization_grant_type', 'client_id', 'client_secret', ]

View File

@ -9,6 +9,8 @@ from passbook.core.models import Provider
class OAuth2Provider(Provider, AbstractApplication):
"""Associate an OAuth2 Application with a Product"""
form = 'passbook.oauth_provider.forms.OAuth2ProviderForm'
def __str__(self):
return self.name