fix a few minor issues that have broken the User Token creation

see: https://github.com/ansible/tower/issues/1928
This commit is contained in:
Ryan Petrello 2018-05-25 17:21:43 -04:00
parent 0fca495792
commit af7ec17ccd
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777
2 changed files with 5 additions and 5 deletions

View File

@ -1073,7 +1073,7 @@ class UserAuthorizedTokenSerializer(BaseOAuth2TokenSerializer):
validated_data['expires'] = now() + timedelta(
seconds=settings.OAUTH2_PROVIDER['ACCESS_TOKEN_EXPIRE_SECONDS']
)
obj = super(OAuth2TokenSerializer, self).create(validated_data)
obj = super(UserAuthorizedTokenSerializer, self).create(validated_data)
obj.save()
if obj.application is not None:
RefreshToken.objects.create(

View File

@ -42,11 +42,11 @@ function AddTokensController (
required: true,
_component: 'at-input-select',
_data: [
strings.get('add.SCOPE_PLACEHOLDER'),
strings.get('add.SCOPE_READ_LABEL'),
strings.get('add.SCOPE_WRITE_LABEL')
{ label: strings.get('add.SCOPE_PLACEHOLDER'), value: '' },
{ label: strings.get('add.SCOPE_READ_LABEL'), value: 'read' },
{ label: strings.get('add.SCOPE_WRITE_LABEL'), value: 'write' }
],
_exp: 'choice for (index, choice) in state._data',
_exp: 'choice.value as choice.label for (index, choice) in state._data',
_format: 'array'
};