remove default app creation

This commit is contained in:
adamscmRH
2018-02-23 15:15:14 -05:00
parent 87350e1014
commit 30b473b0df
5 changed files with 12 additions and 63 deletions

View File

@@ -594,7 +594,7 @@ class OAuth2ApplicationAccess(BaseAccess):
class OAuth2TokenAccess(BaseAccess):
'''
I can read, change or delete an OAuth token when:
I can read, change or delete an OAuth2 token when:
- I am a superuser.
- I am the admin of the organization of the user of the token.
- I am the user of the token.

View File

@@ -620,12 +620,12 @@ def create_access_token_user_if_missing(sender, **kwargs):
post_save.connect(create_access_token_user_if_missing, sender=OAuth2AccessToken)
@receiver(post_save, sender=User)
def create_default_oauth_app(sender, **kwargs):
if kwargs.get('created', False):
user = kwargs['instance']
OAuth2Application.objects.create(
name='Default application for {}'.format(user.username),
user=user, client_type='confidential', redirect_uris='',
authorization_grant_type='password'
)
# @receiver(post_save, sender=User)
# def create_default_oauth_app(sender, **kwargs):
# if kwargs.get('created', False):
# user = kwargs['instance']
# OAuth2Application.objects.create(
# name='Default application for {}'.format(user.username),
# user=user, client_type='confidential', redirect_uris='',
# authorization_grant_type='password'
# )